2021-11-18 04:07:14 +08:00
|
|
|
const Page = require('../core/page');
|
|
|
|
const { openSettings } = require('./util');
|
|
|
|
const e = require('../core/elements');
|
2021-11-16 00:42:29 +08:00
|
|
|
|
|
|
|
class Language extends Page {
|
|
|
|
constructor(browser, page) {
|
|
|
|
super(browser, page);
|
|
|
|
}
|
|
|
|
|
|
|
|
async test(locale) {
|
2021-12-23 03:06:42 +08:00
|
|
|
for(let locale of e.locales) {
|
|
|
|
console.log(`Testing ${locale} locale`);
|
|
|
|
await openSettings(this.page);
|
|
|
|
await this.page.waitForSelector('#langSelector');
|
|
|
|
const langDropdown = await this.page.$('#langSelector');
|
|
|
|
const langOptions = await langDropdown.$$('option');
|
|
|
|
await langDropdown.selectOption({ value: locale });
|
|
|
|
await this.page.click(e.modalConfirmButton);
|
|
|
|
}
|
2021-11-16 00:42:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.Language = Language;
|