Fix E2E tests

This commit is contained in:
Chocobozzz 2021-11-24 10:49:12 +01:00
parent 17e2705f64
commit 450de91e22
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
6 changed files with 15 additions and 3 deletions

View 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()

View 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
}
}

View 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
}
}

View 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')
}

View File

@ -7,7 +7,6 @@ import {
cleanupTests,
createMultipleServers,
doubleFollow,
expectNoFailedTranscodingJob,
expectStartWith,
makeRawRequest,
ObjectStorageCommand,

View 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