-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: use playwright for integration tests #2634
Conversation
…#2500) Co-authored-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
disable webkit and firefox tests for now Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
… used across platforms Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
gonna look into setting up a playwright "fixture" so the api is a bit closer to what we have with puppeteer. so instead of passing test("handles files under upload size limit", async ({ page }) => {
let uploadFile = path.join(
fixture.projectDir,
"toUpload",
"underLimit.txt"
);
let uploadData = Array(1_000).fill("a").join(""); // 1kb
await fs
.mkdir(path.dirname(uploadFile), { recursive: true })
.catch(() => {});
await fs.writeFile(uploadFile, uploadData, "utf8");
await app.goto(page, "/file-upload");
await app.uploadFile(page, "#file", uploadFile);
await app.clickSubmitButton(page, "/file-upload");
}) we can instead do this test("handles files under upload size limit", async ({ page, idkthenameyet }) => {
let uploadFile = path.join(
fixture.projectDir,
"toUpload",
"underLimit.txt"
);
let uploadData = Array(1_000).fill("a").join(""); // 1kb
await fs
.mkdir(path.dirname(uploadFile), { recursive: true })
.catch(() => {});
await fs.writeFile(uploadFile, uploadData, "utf8");
await idkthenameyet.goto("/file-upload");
await idkthenameyet.uploadFile("#file", uploadFile);
await idkthenameyet.clickSubmitButton("/file-upload");
}) actually... being that we need to create our fixture app before we try to use playwright we may have to do it more like so test("handles files under upload size limit", async ({ page }) => {
let app = new PlaywrightFixture(appFixture, page);
let uploadFile = path.join(
fixture.projectDir,
"toUpload",
"underLimit.txt"
);
let uploadData = Array(1_000).fill("a").join(""); // 1kb
await fs
.mkdir(path.dirname(uploadFile), { recursive: true })
.catch(() => {});
await fs.writeFile(uploadFile, uploadData, "utf8");
await app.goto("/file-upload");
await app.uploadFile("#file", uploadFile);
await app.clickSubmitButton("/file-upload");
}) as you can't access the |
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. I just have a couple of things for now. I'll pull this down and try it out soon.
packages/remix-dev/package.json
Outdated
@@ -29,6 +29,7 @@ | |||
"esbuild": "0.14.22", | |||
"esbuild-plugin-cache": "^0.2.9", | |||
"execa": "^5.1.1", | |||
"esbuild-register": "^3.3.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed as a dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's from a merge conflict, i can remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On that note, how much trouble would it be to clean up the commit history on this branch? If it takes more than 10 seconds, don't bother.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be pretty easy to do, i'll check after lunch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh my git fu is failing me today
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran things locally and went through each file. Just a couple things. This is way faster 👏👏
Oh yeah, could you also update the |
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid 👍
CI is giving us this: |
Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one last question, otherwise I think this is ready to go.
the main differences with playwright compared to jest + puppeteer are
toMatchInlineSnapshot
test.
prefixedtest
and notit
Signed-off-by: Logan McAnsh logan@mcan.sh
Closes: #