aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-24 10:49:12 +0100
committerChocobozzz <me@florianbigard.com>2021-11-24 10:49:12 +0100
commit450de91e22ba1388e14e12ada875c94e0c38f5d3 (patch)
treeca00d4e5ec1915f2bd336103d84c8dac86a34273
parent17e2705f646f00346bfdbb663876b0f022eaeee3 (diff)
downloadPeerTube-450de91e22ba1388e14e12ada875c94e0c38f5d3.tar.gz
PeerTube-450de91e22ba1388e14e12ada875c94e0c38f5d3.tar.zst
PeerTube-450de91e22ba1388e14e12ada875c94e0c38f5d3.zip
Fix E2E tests
-rw-r--r--client/e2e/src/po/my-account.ts2
-rw-r--r--client/e2e/wdio.local-test.conf.ts4
-rw-r--r--client/e2e/wdio.local.conf.ts4
-rw-r--r--server/lib/client-html.ts5
-rw-r--r--server/tests/cli/create-import-video-file-job.ts1
-rw-r--r--support/doc/development/release.md2
6 files changed, 15 insertions, 3 deletions
diff --git a/client/e2e/src/po/my-account.ts b/client/e2e/src/po/my-account.ts
index 8b5e79b5e..b51614fd9 100644
--- a/client/e2e/src/po/my-account.ts
+++ b/client/e2e/src/po/my-account.ts
@@ -39,7 +39,7 @@ export class MyAccountPage {
39 39
40 await container.$('.dropdown-toggle').click() 40 await container.$('.dropdown-toggle').click()
41 41
42 const dropdownMenu = () => container.$('.dropdown-menu .dropdown-item:nth-child(2)') 42 const dropdownMenu = () => container.$$('.dropdown-menu .dropdown-item')[1]
43 43
44 await dropdownMenu().waitForDisplayed() 44 await dropdownMenu().waitForDisplayed()
45 return dropdownMenu().click() 45 return dropdownMenu().click()
diff --git a/client/e2e/wdio.local-test.conf.ts b/client/e2e/wdio.local-test.conf.ts
index 6ae426322..32e6d340c 100644
--- a/client/e2e/wdio.local-test.conf.ts
+++ b/client/e2e/wdio.local-test.conf.ts
@@ -4,6 +4,9 @@ const prefs = {
4 'intl.accept_languages': 'en' 4 'intl.accept_languages': 'en'
5} 5}
6 6
7// Chrome headless does not support prefs
8process.env.LANG = 'en'
9
7module.exports = { 10module.exports = {
8 config: { 11 config: {
9 ...mainConfig, 12 ...mainConfig,
@@ -18,6 +21,7 @@ module.exports = {
18 browserName: 'chrome', 21 browserName: 'chrome',
19 acceptInsecureCerts: true, 22 acceptInsecureCerts: true,
20 'goog:chromeOptions': { 23 'goog:chromeOptions': {
24 args: [ '--headless', '--disable-gpu', '--window-size=1280,1024' ],
21 prefs 25 prefs
22 } 26 }
23 } 27 }
diff --git a/client/e2e/wdio.local.conf.ts b/client/e2e/wdio.local.conf.ts
index a4c517f5e..43b820ca6 100644
--- a/client/e2e/wdio.local.conf.ts
+++ b/client/e2e/wdio.local.conf.ts
@@ -3,6 +3,7 @@ import { config as mainConfig } from './wdio.main.conf'
3const prefs = { 3const prefs = {
4 'intl.accept_languages': 'en' 4 'intl.accept_languages': 'en'
5} 5}
6process.env.LANG = 'en'
6 7
7module.exports = { 8module.exports = {
8 config: { 9 config: {
@@ -16,6 +17,7 @@ module.exports = {
16 { 17 {
17 browserName: 'chrome', 18 browserName: 'chrome',
18 'goog:chromeOptions': { 19 'goog:chromeOptions': {
20 args: [ '--headless', '--disable-gpu', '--window-size=1280,1024' ],
19 prefs 21 prefs
20 } 22 }
21 }, 23 },
@@ -23,6 +25,8 @@ module.exports = {
23 browserName: 'firefox', 25 browserName: 'firefox',
24 'moz:firefoxOptions': { 26 'moz:firefoxOptions': {
25 binary: '/usr/bin/firefox-developer-edition', 27 binary: '/usr/bin/firefox-developer-edition',
28 args: [ '--headless', '--window-size=1280,1024' ],
29
26 prefs 30 prefs
27 } 31 }
28 } 32 }
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index 84b4ca97d..84eb33348 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -335,6 +335,11 @@ class ClientHtml {
335 lang = req.acceptsLanguages(POSSIBLE_LOCALES) || getDefaultLocale() 335 lang = req.acceptsLanguages(POSSIBLE_LOCALES) || getDefaultLocale()
336 } 336 }
337 337
338 logger.debug(
339 'Serving %s HTML language', buildFileLocale(lang),
340 { cookie: req.cookies?.clientLanguage, paramLang, acceptLanguage: req.headers['accept-language'] }
341 )
342
338 return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html') 343 return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html')
339 } 344 }
340 345
diff --git a/server/tests/cli/create-import-video-file-job.ts b/server/tests/cli/create-import-video-file-job.ts
index 17ed67b05..c06b9550c 100644
--- a/server/tests/cli/create-import-video-file-job.ts
+++ b/server/tests/cli/create-import-video-file-job.ts
@@ -7,7 +7,6 @@ import {
7 cleanupTests, 7 cleanupTests,
8 createMultipleServers, 8 createMultipleServers,
9 doubleFollow, 9 doubleFollow,
10 expectNoFailedTranscodingJob,
11 expectStartWith, 10 expectStartWith,
12 makeRawRequest, 11 makeRawRequest,
13 ObjectStorageCommand, 12 ObjectStorageCommand,
diff --git a/support/doc/development/release.md b/support/doc/development/release.md
index deabe5687..bb055b7b7 100644
--- a/support/doc/development/release.md
+++ b/support/doc/development/release.md
@@ -13,7 +13,7 @@ NODE_APP_INSTANCE=6 NODE_ENV=test npm run start
13 * 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 13 * 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
14 * Update https://peertube2.cpy.re and check it works correctly 14 * Update https://peertube2.cpy.re and check it works correctly
15 * Check CI tests are green 15 * Check CI tests are green
16 * Run BrowserStack and local E2E tests 16 * Run BrowserStack **and** local E2E tests
17 * Release: `GITHUB_TOKEN=my_token npm run release -- 1.x.x` 17 * Release: `GITHUB_TOKEN=my_token npm run release -- 1.x.x`
18 * Create a dedicated branch: `git checkout -b release/1.x.x && git push origin release/1.x.x` 18 * Create a dedicated branch: `git checkout -b release/1.x.x && git push origin release/1.x.x`
19 * Check the release is okay: https://github.com/Chocobozzz/PeerTube/releases 19 * Check the release is okay: https://github.com/Chocobozzz/PeerTube/releases