-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added test for changing language on init page
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
packages/e2e-tests/test/00_1_changingLanguageInitSteps.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { expect } from 'chai'; | ||
import InitialStepsPage from '../pages/initialSteps.page.js'; | ||
import BasePage from '../pages/basepage.js'; | ||
import { getDriver } from '../utils/driverBootstrap.js'; | ||
import { customAfterEach } from '../utils/customHooks.js'; | ||
import { getTestLogger } from '../utils/utils.js'; | ||
import { oneMinute } from '../helpers/timeConstants.js'; | ||
|
||
describe('Changing language on the initial screen', function () { | ||
this.timeout(2 * oneMinute); | ||
let webdriver = null; | ||
let logger = null; | ||
|
||
before(function (done) { | ||
webdriver = getDriver(); | ||
logger = getTestLogger(this.test.parent.title); | ||
const basePage = new BasePage(webdriver, logger); | ||
basePage.goToExtension(); | ||
done(); | ||
}); | ||
|
||
const testData = [ | ||
{ | ||
lang: 'ja-JP', | ||
btnTransalation: '次へ', | ||
}, | ||
{ | ||
lang: 'zh-Hans', | ||
btnTransalation: '继续', | ||
}, | ||
{ | ||
lang: 'ru-RU', | ||
btnTransalation: 'Продолжить', | ||
}, | ||
{ | ||
lang: 'de-DE', | ||
btnTransalation: 'Weiter', | ||
}, | ||
{ | ||
lang: 'pt-BR', | ||
btnTransalation: 'Continuar', | ||
}, | ||
{ | ||
lang: 'en-US', | ||
btnTransalation: 'Continue', | ||
}, | ||
]; | ||
|
||
for (const testDatum of testData) { | ||
describe(`Changing language to ${testDatum.lang}`, function () { | ||
it('Selecting language', async function () { | ||
const initialStepsPage = new InitialStepsPage(webdriver, logger); | ||
await initialStepsPage.selectLanguage(testDatum.lang); | ||
}); | ||
|
||
it('Checking translation on the button', async function () { | ||
const initialStepsPage = new InitialStepsPage(webdriver, logger); | ||
const btnText = await initialStepsPage.getContinueButtonText(); | ||
expect(btnText).to.equal(testDatum.btnTransalation.toLocaleUpperCase()); | ||
}); | ||
}); | ||
} | ||
|
||
afterEach(function (done) { | ||
customAfterEach(this, webdriver, logger); | ||
done(); | ||
}); | ||
|
||
after(function (done) { | ||
const basePage = new BasePage(webdriver, logger); | ||
basePage.closeBrowser(); | ||
done(); | ||
}); | ||
}); |