workadventure/tests/tests/translate.ts

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-01-21 17:06:03 +01:00
import { Selector } from "testcafe";
import { login } from "./utils/roles";
2022-01-21 17:06:03 +01:00
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) => {
2022-01-21 17:06:03 +01:00
const languageSelect = Selector(".languages-switcher");
const languageOption = languageSelect.find("option");
2022-01-21 17:06:03 +01:00
await login(
t,
"http://play.workadventure.localhost/_/global/maps.workadventure.localhost/tests/mousewheel.json"
);
2022-01-21 17:06:03 +01:00
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)
2022-01-21 17:06:03 +01:00
.click(".menuIcon img:first-child")
.expect(Selector("button").withText("Paramètres").innerText)
.contains("Paramètres");
2022-01-21 17:06:03 +01:00
t.ctx.passed = true;
}).after(async (t) => {
if (!t.ctx.passed) {
console.log("Test failed. Browser logs:");
console.log(await t.getBrowserConsoleMessages());
}
});