Skip to content

Upgrade playwright to 1.0.0 - #2383

Merged
DavertMik merged 12 commits into
codeceptjs:masterfrom
Georgegriff:playwright1_0
May 11, 2020
Merged

Upgrade playwright to 1.0.0#2383
DavertMik merged 12 commits into
codeceptjs:masterfrom
Georgegriff:playwright1_0

Conversation

@Georgegriff

@Georgegriff Georgegriff commented May 8, 2020

Copy link
Copy Markdown
Collaborator

Motivation/Description of the PR

  • Upgrade playwright to their first Major release.
  • 2 breaking changes: waitFor method gone, and waitFor attribute of waitForSelector ranamed to state
  • networkidle2 removed, networkidle0 === networkidle

Applicable helpers:

  • WebDriver
  • Puppeteer
  • Nightmare
  • REST
  • FileHelper
  • Appium
  • Protractor
  • TestCafe
  • Playwright

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • puppeteerCoverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • wdio

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

DavertMik
DavertMik previously approved these changes May 8, 2020

@DavertMik DavertMik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After 1.0 their API should be stable so I think it is fine if we replace all links to "master" version and ask for any version in 1.x scope.

Comment thread docs/custom-helpers.md Outdated
Comment thread docs/helpers/Playwright.md Outdated
Comment thread docs/helpers/Playwright.md Outdated
Comment thread docs/helpers/Playwright.md Outdated
Comment thread docs/playwright.md Outdated
Comment thread docs/playwright.md Outdated
Comment thread lib/helper/Playwright.js Outdated
Comment thread lib/helper/Playwright.js Outdated
Comment thread lib/helper/Playwright.js Outdated
Comment thread lib/helper/Playwright.js Outdated
@Georgegriff

Copy link
Copy Markdown
Collaborator Author

Seems the tests are failing to start the browser + some other issues :/ not sure why. I've run out of time to look at this today

Vorobeyko
Vorobeyko previously approved these changes May 8, 2020
@arjunattam

Copy link
Copy Markdown

Did some locally testing on the docker image that's used in Travis (selenium/standalone-chrome:3.141.59-oxygen), and it seems to be missing libgbm which is required by newer Chromium. Running sudo apt install libgbm1 in the container fixes it.

To debug, you can set DEBUG=pw:browser* before running the test.

@DavertMik

Copy link
Copy Markdown
Contributor

Thank you very much @arjun27!

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

One of the builds work now, but Travis build failing with

Playwright
       "before each" hook for "should open main page of configured site":
     Error: Failed to launch browser: Error: spawn /home/travis/.cache/ms-playwright/chromium-764964/chrome-linux/chrome ENOENT

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

I've tried to fix travis based on: https://github.com/microsoft/playwright/blob/master/docs/troubleshooting.md#running-playwright-on-travis-ci but no luck :/ some help would be greatly appreciated!

@DavertMik

Copy link
Copy Markdown
Contributor

Ok, the solution here would be to switch to Github Actions for Playwright unit tests.

@DavertMik

Copy link
Copy Markdown
Contributor

@Georgegriff
let's do the following

  • remove Playwright from Travis CI matrix
  • create a new job inside .github/workflows/playwright and name it Unit Tests
  • run command for Playwright tests inside that job

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

@DavertMik
image success! The tests identified one tweak to make:
3c2650f

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

Looks like cicleCI had issues installing playwright
image

@Georgegriff

Georgegriff commented May 11, 2020

Copy link
Copy Markdown
Collaborator Author

@DavertMik seems like that circle ci install error might be transient because the other docker builds worked

@DavertMik

Copy link
Copy Markdown
Contributor

@Georgegriff Thanks!
Looks like CircleCI has an issue building a Docker image with Playwright included.
We can either:

  • discover what fails the build and update Docker image so installation would pass
  • remove playwright from Docker build
  • replace playwright to playwright-core for Docker build

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

If you look at the build you'll see in other docker builds in circle ci it worked :/ err was probably in downloading a browser or something

@DavertMik

Copy link
Copy Markdown
Contributor

err was probably in downloading a browser or something

Yeah, I think so... How the unit test are different here, not sure (

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

It's quite possible it would work if we re ran it

@Georgegriff

Copy link
Copy Markdown
Collaborator Author

All passed now

@DavertMik
DavertMik merged commit ba3808e into codeceptjs:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants