Skip to content
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

Increase browser coverage on automated tests #156

Closed
samreid opened this issue Aug 8, 2022 · 9 comments
Closed

Increase browser coverage on automated tests #156

samreid opened this issue Aug 8, 2022 · 9 comments
Assignees

Comments

@samreid
Copy link
Member

samreid commented Aug 8, 2022

From phetsims/chipper#1273 and similar to #80, it is now possible to run automated testing with more browser testing. Currently we are using the version of chromium that ships with puppeter, but puppeteer can also test in firefox now. Also, if we expand to playwright, it can additionally test on webkit.

Keep in mind this is separate from the problem of having separate dedicated computers running browser tests, which could be iPads, chromebooks, laptops, etc. This issue is about automated headless testing.

@zepumph
Copy link
Member

zepumph commented May 1, 2023

Good progress here today! I was able to get a firefox instance loading with a tool in perennial called PERENNIAL/playwrightLoad. I'm not using this is CT just yet, but will soon!

@zepumph zepumph self-assigned this May 1, 2023
zepumph added a commit to phetsims/perennial that referenced this issue May 2, 2023
zepumph added a commit to phetsims/perennial that referenced this issue May 2, 2023
zepumph added a commit that referenced this issue May 2, 2023
zepumph added a commit to phetsims/perennial that referenced this issue May 2, 2023
zepumph added a commit that referenced this issue May 2, 2023
@zepumph
Copy link
Member

zepumph commented May 3, 2023

Alright, I loaded sparky ct clients up with 30 firefox and 70 puppeteer clients. Good luck us!

@zepumph
Copy link
Member

zepumph commented May 4, 2023

I renamed the server processes to ct-browser-clients (instead of "chrome" specific).

zepumph added a commit that referenced this issue May 8, 2023
zepumph added a commit that referenced this issue May 8, 2023
zepumph added a commit that referenced this issue May 8, 2023
zepumph added a commit to phetsims/perennial that referenced this issue May 8, 2023
zepumph added a commit that referenced this issue May 8, 2023
@zepumph
Copy link
Member

zepumph commented May 8, 2023

phetsims/perennial@34c2a69 was hiding a problem that launching a browser is timing out:

Worker307 Error from browser client: browserType.launch: Timeout 180000ms exceeded.
3|ct-brows | 2023-05-08T12:11:17:     at module.exports (/data/share/phet/continuous-testing/ct-browser-clients/perennial/js/common/browserPageLoad.js:57:55)
3|ct-brows | 2023-05-08T12:11:17:     at module.exports (/data/share/phet/continuous-testing/ct-browser-clients/perennial/js/common/playwrightLoad.js:28:10)
3|ct-brows | 2023-05-08T12:11:17:     at /data/share/phet/continuous-testing/ct-browser-clients/aqua/js/server/playwrightCTClient.js:31:23
3|ct-brows | 2023-05-08T12:11:17:     at Object.<anonymous> (/data/share/phet/continuous-testing/ct-browser-clients/aqua/js/server/playwrightCTClient.js:49:4) {
3|ct-brows | 2023-05-08T12:11:17:   name: 'TimeoutError'
3|ct-brows | 2023-05-08T12:11:17: }

I'm going to increase the timeout.

https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-timeout

@zepumph
Copy link
Member

zepumph commented May 8, 2023

And after the above, we got this error:

Worker99 Error from browser client: browserType.launch:
3|ct-browser-clients  | 2023-05-08T12:23:02: ╔══════════════════════════════════════════════════════╗
3|ct-browser-clients  | 2023-05-08T12:23:02: ║ Host system is missing dependencies to run browsers. ║
3|ct-browser-clients  | 2023-05-08T12:23:02: ║ Missing libraries:                                   ║
3|ct-browser-clients  | 2023-05-08T12:23:02: ║     libdbus-glib-1.so.2                              ║
3|ct-browser-clients  | 2023-05-08T12:23:02: ╚══════════════════════════════════════════════════════╝
3|ct-browser-clients  | 2023-05-08T12:23:02:     at module.exports (/data/share/phet/continuous-testing/ct-browser-clients/perennial/js/common/browserPageLoad.js:57:55)
3|ct-browser-clients  | 2023-05-08T12:23:02:     at module.exports (/data/share/phet/continuous-testing/ct-browser-clients/perennial/js/common/playwrightLoad.js:28:10)
3|ct-browser-clients  | 2023-05-08T12:23:02:     at /data/share/phet/continuous-testing/ct-browser-clients/aqua/js/server/playwrightCTClient.js:31:23
3|ct-browser-clients  | 2023-05-08T12:23:02:     at Object.<anonymous> (/data/share/phet/continuous-testing/ct-browser-clients/aqua/js/server/playwrightCTClient.js:53:4) {
3|ct-browser-clients  | 2023-05-08T12:23:02:   name: 'Error'
3|ct-browser-clients  | 2023-05-08T12:23:02: }

@jonathanolson helped me install this dependency and we finally have our first CT reporting from Sparky Playwright Firefox.

I'll check back in later to see if we are having any issues from the playwright, vs the actual failing test.

@jonathanolson's commands to install a package that we were only medium confident that this would solve things:
sudo dnf search dbus
sudo dnf install dbus-glib.x86_64

@zepumph
Copy link
Member

zepumph commented May 9, 2023

@jonathanolson and I discussed today, and would like to investigate a bit more into webkit in Playwright before closing this issue.

@zepumph
Copy link
Member

zepumph commented May 9, 2023

  • Check the logs and see if firefox is causing any trouble.

@zepumph
Copy link
Member

zepumph commented May 10, 2023

For testing webkit I was using this script:

( async () => {
  const playwrightLoad = require( './perennial/js/common/playwrightLoad.js' );
  const playwright = require( './perennial/node_modules/playwright' );

  await ( playwrightLoad( 'https://sparky.colorado.edu/continuous-testing/density/density_en.html?ea&brand=phet', {
    logConsoleOutput: true,
    testingBrowserCreator: playwright.webkit,
    logNavigation: true,
    logger: console.log,
    evaluate: () => {
      console.log( window.navigator.userAgent );
    }
  } ) );
} )();

When I try to run webkit on windows, I run into microsoft/playwright#14105, and am trying to see if stubbing it is worth my time (it probably isn't, but here is a patch)

When I run this on sparky, I need these dependencies, perhaps @jonathanolson can help me with that sometime tomorrow:

[phet@sparky tmp]$ node js.js
browserType.launch:
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║
║ Missing libraries:                                   ║
║     libicudata.so.66                                 ║
║     libicui18n.so.66                                 ║
║     libicuuc.so.66                                   ║
║     libwoff2dec.so.1.0.2                             ║
║     libharfbuzz-icu.so.0                             ║
║     libgstcodecparsers-1.0.so.0                      ║
║     libjpeg.so.8                                     ║
║     libwebp.so.6                                     ║
║     libenchant-2.so.2                                ║
║     libsecret-1.so.0                                 ║
║     libhyphen.so.0                                   ║
║     libXt.so.6                                       ║
║     libflite.so.1                                    ║
║     libflite_usenglish.so.1                          ║
║     libflite_cmu_grapheme_lang.so.1                  ║
║     libflite_cmu_grapheme_lex.so.1                   ║
║     libflite_cmu_indic_lang.so.1                     ║
║     libflite_cmu_indic_lex.so.1                      ║
║     libflite_cmulex.so.1                             ║
║     libflite_cmu_time_awb.so.1                       ║
║     libflite_cmu_us_awb.so.1                         ║
║     libflite_cmu_us_kal16.so.1                       ║
║     libflite_cmu_us_kal.so.1                         ║
║     libflite_cmu_us_rms.so.1                         ║
║     libflite_cmu_us_slt.so.1                         ║
║     libpcre.so.3                                     ║
║     libffi.so.7                                      ║
║     libGLESv2.so.2                                   ║
║     libx264.so                                       ║
╚══════════════════════════════════════════════════════╝
    at module.exports (/data/share/phet/continuous-testing/ct-main/perennial/js/common/browserPageLoad.js:57:55)
    at module.exports (/data/share/phet/continuous-testing/ct-main/perennial/js/common/playwrightLoad.js:28:10)
    at /data/share/phet/continuous-testing/ct-main/tmp/js.js:5:11
    at Object.<anonymous> (/data/share/phet/continuous-testing/ct-main/tmp/js.js:14:4) {
  name: 'Error'
}
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

@zepumph zepumph assigned jonathanolson and unassigned zepumph May 10, 2023
@zepumph
Copy link
Member

zepumph commented May 12, 2023

Yesterday @jonathanolson and I spent some time seeing if these could get installed we got about half way and couldn't get any further. Then we found that RHEL isn't supported, microsoft/playwright#6140.

So For safari we will take things up over in https://github.com/phetsims/special-ops/issues/243. Firefox is working well, and we will keep adapting the new client over in #178. Closing

@zepumph zepumph closed this as completed May 12, 2023
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

No branches or pull requests

3 participants