]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix E2E tests
authorChocobozzz <me@florianbigard.com>
Wed, 24 Nov 2021 09:49:12 +0000 (10:49 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 24 Nov 2021 09:49:12 +0000 (10:49 +0100)
client/e2e/src/po/my-account.ts
client/e2e/wdio.local-test.conf.ts
client/e2e/wdio.local.conf.ts
server/lib/client-html.ts
server/tests/cli/create-import-video-file-job.ts
support/doc/development/release.md

index 8b5e79b5ee3b9fda65879e5f31a57657f656a09f..b51614fd994f71cc9b3bbbb6a0d4111f92bd40e6 100644 (file)
@@ -39,7 +39,7 @@ export class MyAccountPage {
 
     await container.$('.dropdown-toggle').click()
 
-    const dropdownMenu = () => container.$('.dropdown-menu .dropdown-item:nth-child(2)')
+    const dropdownMenu = () => container.$$('.dropdown-menu .dropdown-item')[1]
 
     await dropdownMenu().waitForDisplayed()
     return dropdownMenu().click()
index 6ae42632213cacd24002640c61586166aad19e57..32e6d340ce2bd03bcb640b86cf3cfe5546233d91 100644 (file)
@@ -4,6 +4,9 @@ const prefs = {
   'intl.accept_languages': 'en'
 }
 
+// Chrome headless does not support prefs
+process.env.LANG = 'en'
+
 module.exports = {
   config: {
     ...mainConfig,
@@ -18,6 +21,7 @@ module.exports = {
         browserName: 'chrome',
         acceptInsecureCerts: true,
         'goog:chromeOptions': {
+          args: [ '--headless', '--disable-gpu', '--window-size=1280,1024' ],
           prefs
         }
       }
index a4c517f5e303cb169b844b59f1f03018719e3ae2..43b820ca6c1a5b7076fa04e0c0672fd3416b440e 100644 (file)
@@ -3,6 +3,7 @@ import { config as mainConfig } from './wdio.main.conf'
 const prefs = {
   'intl.accept_languages': 'en'
 }
+process.env.LANG = 'en'
 
 module.exports = {
   config: {
@@ -16,6 +17,7 @@ module.exports = {
       {
         browserName: 'chrome',
         'goog:chromeOptions': {
+          args: [ '--headless', '--disable-gpu', '--window-size=1280,1024' ],
           prefs
         }
       },
@@ -23,6 +25,8 @@ module.exports = {
         browserName: 'firefox',
         'moz:firefoxOptions': {
           binary: '/usr/bin/firefox-developer-edition',
+          args: [ '--headless', '--window-size=1280,1024' ],
+
           prefs
         }
       }
index 84b4ca97def8477dd034e2d85a7366e36c4e8a7e..84eb333481f044ba0fa2318aba15f76517d74f0d 100644 (file)
@@ -335,6 +335,11 @@ class ClientHtml {
       lang = req.acceptsLanguages(POSSIBLE_LOCALES) || getDefaultLocale()
     }
 
+    logger.debug(
+      'Serving %s HTML language', buildFileLocale(lang),
+      { cookie: req.cookies?.clientLanguage, paramLang, acceptLanguage: req.headers['accept-language'] }
+    )
+
     return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html')
   }
 
index 17ed67b0593f476a53dbb6194dfcc9ce15e8945e..c06b9550cb4d611216c657f9c15da7aa2978d850 100644 (file)
@@ -7,7 +7,6 @@ import {
   cleanupTests,
   createMultipleServers,
   doubleFollow,
-  expectNoFailedTranscodingJob,
   expectStartWith,
   makeRawRequest,
   ObjectStorageCommand,
index deabe56870e9a07e6529c3f0cf8723b84813632f..bb055b7b7db984514831f55f80266bda510d4da1 100644 (file)
@@ -13,7 +13,7 @@ NODE_APP_INSTANCE=6 NODE_ENV=test npm run start
  * Run `rm -rf node_modules && rm -rf client/node_modules && yarn install --pure-lockfile && npm run build` to see if all the supported languages compile correctly
  * Update https://peertube2.cpy.re and check it works correctly
  * Check CI tests are green
- * Run BrowserStack and local E2E tests
+ * Run BrowserStack **and** local E2E tests
  * Release: `GITHUB_TOKEN=my_token npm run release -- 1.x.x`
  * Create a dedicated branch: `git checkout -b release/1.x.x && git push origin release/1.x.x`
  * Check the release is okay: https://github.com/Chocobozzz/PeerTube/releases