Implement typesafe-i18n
This commit is contained in:
parent
0be77164ec
commit
446b4639c7
97 changed files with 1162 additions and 1341 deletions
|
@ -1,29 +1,34 @@
|
|||
import { Selector } from 'testcafe';
|
||||
import {login} from "./utils/roles";
|
||||
import { Selector } from "testcafe";
|
||||
import { login } from "./utils/roles";
|
||||
|
||||
fixture `Translation`
|
||||
.page `http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/mousewheel.json`;
|
||||
fixture`Translation`
|
||||
.page`http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/mousewheel.json`;
|
||||
|
||||
test("Test that I can switch to French", async (t: TestController) => {
|
||||
const languageSelect = Selector(".languages-switcher");
|
||||
const languageOption = languageSelect.find("option");
|
||||
|
||||
const languageSelect = Selector('.languages-switcher');
|
||||
const languageOption = languageSelect.find('option');
|
||||
await login(
|
||||
t,
|
||||
"http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/mousewheel.json"
|
||||
);
|
||||
|
||||
await login(t, 'http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/mousewheel.json');
|
||||
await t
|
||||
.click(".menuIcon img:first-child")
|
||||
.click(Selector("button").withText("Settings"))
|
||||
.click(".languages-switcher")
|
||||
.click(languageOption.withText("Français (France)"))
|
||||
.click(Selector("button").withText("Save"))
|
||||
.wait(5000)
|
||||
|
||||
await t.click('.menuIcon img:first-child')
|
||||
.click(Selector('button').withText('Settings'))
|
||||
.click('.languages-switcher')
|
||||
.click(languageOption.withText('Français (France)'))
|
||||
.click(Selector('button').withText('Save'))
|
||||
.click(".menuIcon img:first-child")
|
||||
.expect(Selector("button").withText("Paramètres").innerText)
|
||||
.contains("Paramètres");
|
||||
|
||||
.click('.menuIcon img:first-child')
|
||||
.expect(Selector('button').withText('Paramètres').innerText).contains('Paramètres');
|
||||
|
||||
t.ctx.passed = true;
|
||||
}).after(async t => {
|
||||
if (!t.ctx.passed) {
|
||||
console.log("Test failed. Browser logs:")
|
||||
console.log(await t.getBrowserConsoleMessages());
|
||||
}
|
||||
t.ctx.passed = true;
|
||||
}).after(async (t) => {
|
||||
if (!t.ctx.passed) {
|
||||
console.log("Test failed. Browser logs:");
|
||||
console.log(await t.getBrowserConsoleMessages());
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue