From 699b1a7d7dfebadf40e6c5fe0e0c8408540ca0bc Mon Sep 17 00:00:00 2001 From: silas Date: Mon, 1 Oct 2018 14:33:15 +0200 Subject: [PATCH] Tests angepasst --- test/test.testcafe.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/test.testcafe.js b/test/test.testcafe.js index 52b65ab..9d1a7cc 100644 --- a/test/test.testcafe.js +++ b/test/test.testcafe.js @@ -92,8 +92,8 @@ test('Play', async t => { .expect(Selector('.tutorial-text .step-2').visible).eql(true) .click(Selector('.segment-parent').nth(SEGMENT.THREE)) .expect(Selector('#continue-button').visible).eql(true) - // .wait(3500) - .click(Selector('#continue-button')); + .click(Selector('#continue-button')) + .wait(1000); levelNumber++; //first Level @@ -382,7 +382,7 @@ test('LevelRotation', async t => { .click(Selector('.segment-parent').nth(SEGMENT.THREE)) .click(Selector('.segment-parent').nth(SEGMENT.THREE)) .click(Selector('.segment-parent').nth(SEGMENT.THREE)) - .wait(3750) + .wait(3000) .expect(Selector('.segment-parent').nth(SEGMENT.THREE).getStyleProperty('transform')).eql("matrix(0, -1, 1, 0, 0, 0)") .expect(Selector('.segment-parent').nth(SEGMENT.FOUR).getStyleProperty('transform')).eql("matrix(0, 1, -1, 0, 0, 0)") .click(Selector('.segment-parent').nth(SEGMENT.THREE)) @@ -411,7 +411,7 @@ test('LevelRotation', async t => { }).before(async t => { await replaceRandom([0.9, 0.5]); }); -test.only('SendUserstats', async t => { +test('SendUserstats', async t => { let matomoCheck = ClientFunction(() => { return fetch("//matomo.silas.link/index.php?module=API&method=AjaxOptOut.isTracked", { "mode": "cors", @@ -439,4 +439,19 @@ test.only('SendUserstats', async t => { await t.expect(res).ok() }).before(async t => { await testLocalStorageSet("matomoShouldTrack", "1"); +}); + +test('Themes', async t => { + await testLocalStorageSet("currentTheme", "dark"); + await t + .expect(Selector("body.dark").visible).ok() + .click(Selector(".action [data-translation-title='settings']")) + .expect(Selector("#theme-name").innerText).eql("Dunkel") + .click(Selector("#theme-name")) + .click(Selector(".name [data-translation]").nth(3)) + .wait(100) + .expect(Selector("#theme-name").innerText).eql("GrĂ¼n") + .expect(Selector("body.green").visible).ok() +}).before(async t => { + testLocalStorageSet("currentTheme", "dark"); }); \ No newline at end of file