Skip to content

chore: upgrade to Playwright 1.12 with its new test-runner #3590

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

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

mxschmitt
Copy link
Contributor

Does it require changes in the changelog?

This upgrades it to the new Playwright test-runner.

@mxschmitt mxschmitt requested a review from a team as a code owner June 10, 2021 13:11
@@ -413,7 +412,7 @@ export const isObject = <T extends object>(obj: T): obj is T => {
* we don't have to set up a `vs` alias to be able to import with types (since
* the alternative is to directly import from `out`).
*/
const enum CharCode {
enum CharCode {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playwright's test-runner uses babel-plugin-transform-typescript which does not support const enums. See here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 🎉

@@ -6,7 +6,7 @@ main() {
cd test
# We set these environment variables because they're used in the e2e tests
# they don't have to be these values, but these are the defaults
PASSWORD=e45432jklfdsab CODE_SERVER_ADDRESS=http://localhost:8080 yarn folio --config=config.ts --reporter=list "$@"
PASSWORD=e45432jklfdsab CODE_SERVER_ADDRESS=http://localhost:8080 yarn playwright test "$@"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the two parameters there, to have all Playwright related configuration in its config file. Also playwright.config.ts is easier to understand than config.ts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! playwright.config.ts is easier to understand. Good call!

import { CodeServer } from "./models/CodeServer"

export const test = base.extend<{ codeServerPage: CodeServer }>({
codeServerPage: async ({ page }, use) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a custom test-fixture. This means for every test a new one gets created. Since its using the page, which uses a context, Playwright does automatically take care of closing the context.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah, that is super cool! That's fantastic! 🎉

@oxy oxy requested a review from jsjoeio June 10, 2021 16:06
@oxy oxy added new contributor For PRs by first-time contributor testing Anything related to testing labels Jun 10, 2021
@repo-ranger
Copy link
Contributor

repo-ranger bot commented Jun 10, 2021

Thanks for making your first contribution! 🙂

@codecov
Copy link

codecov bot commented Jun 10, 2021

Codecov Report

Merging #3590 (dbb34ad) into main (9fc9c04) will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3590      +/-   ##
==========================================
+ Coverage   60.53%   60.67%   +0.13%     
==========================================
  Files          35       35              
  Lines        1784     1790       +6     
  Branches      403      404       +1     
==========================================
+ Hits         1080     1086       +6     
  Misses        562      562              
  Partials      142      142              
Impacted Files Coverage Δ
src/node/util.ts 70.94% <100.00%> (+1.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fc9c04...dbb34ad. Read the comment docs.

@oxy
Copy link

oxy commented Jun 10, 2021

Thanks a lot for your contribution! 😄
I'll defer to @jsjoeio on review for this one, since they've been doing most of the work on the testing infrastructure.

@jsjoeio jsjoeio self-assigned this Jun 10, 2021
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Thank you so much for the surprise contribution @mxschmitt 🎉🎉

You've cleaned everything up and also improved our e2e test setup!

Re: CHANGELOG -> no need to update unless you want to! We copy those notes into the release notes and give credit to contributors. Totally up to you! 😄

@@ -6,7 +6,7 @@ main() {
cd test
# We set these environment variables because they're used in the e2e tests
# they don't have to be these values, but these are the defaults
PASSWORD=e45432jklfdsab CODE_SERVER_ADDRESS=http://localhost:8080 yarn folio --config=config.ts --reporter=list "$@"
PASSWORD=e45432jklfdsab CODE_SERVER_ADDRESS=http://localhost:8080 yarn playwright test "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! playwright.config.ts is easier to understand. Good call!

@@ -413,7 +412,7 @@ export const isObject = <T extends object>(obj: T): obj is T => {
* we don't have to set up a `vs` alias to be able to import with types (since
* the alternative is to directly import from `out`).
*/
const enum CharCode {
enum CharCode {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 🎉

import { CodeServer } from "./models/CodeServer"

export const test = base.extend<{ codeServerPage: CodeServer }>({
codeServerPage: async ({ page }, use) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah, that is super cool! That's fantastic! 🎉

@jsjoeio jsjoeio linked an issue Jun 10, 2021 that may be closed by this pull request
@jsjoeio jsjoeio merged commit 4bb7a8d into coder:main Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new contributor For PRs by first-time contributor testing Anything related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade playwright/test to 0.1112.0-alpha1
3 participants