update für die Vorlesung
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
import {Selector} from 'testcafe';
|
||||
import {ClientFunction} from 'testcafe';
|
||||
|
||||
let isLocal = false;
|
||||
let isLocal = true;
|
||||
|
||||
const checkMatrix = async (matrixString, shouldValues) => {
|
||||
let values = (await matrixString).substring(7,matrixString.length -1).split(",");
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
if (Array.isArray(shouldValues[i])){
|
||||
if (shouldValues[i][0] > values[i] || shouldValues[i][1] < values[1]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (shouldValues[i] != values[i]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const goBack = ClientFunction(() => window.history.back());
|
||||
const testLocalStorageSet = ClientFunction((key, value) => {
|
||||
@@ -37,7 +54,8 @@ async function waitForMainMenu(t) {
|
||||
|
||||
if (isLocal) {
|
||||
fixture`Play`
|
||||
.page`https://127.0.0.1/pwa/wordRotator/publicTest/`.beforeEach(async t => {
|
||||
// .page`https://127.0.0.1/pwa/wordRotator/publicTest/`.beforeEach(async t => {
|
||||
.page`https://192.168.0.51/pwa/wordRotator/publicTest/`.beforeEach(async t => {
|
||||
await beforeEachTest(t);
|
||||
}).afterEach(async t => {
|
||||
await afterEachTest(t);
|
||||
@@ -86,7 +104,7 @@ const SEGMENT = {
|
||||
TWENTYONE: 20
|
||||
};
|
||||
|
||||
test('Play', async t => {
|
||||
test.only('Play', async t => {
|
||||
let levelNumber = 1;
|
||||
|
||||
await waitForMainMenu(t);
|
||||
@@ -96,7 +114,7 @@ test('Play', async t => {
|
||||
|
||||
//firstTutorial
|
||||
.expect(Selector('.tutorial-text .step-1').visible).eql(true)
|
||||
.expect(Selector('.tutorial-text .step-2').visible).eql(false)
|
||||
.expect(Selector('.tutorial-text .step-2').visible).eql(false).debug()
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.THREE))
|
||||
.expect(Selector('.tutorial-text .step-2').visible).eql(true)
|
||||
.expect(Selector('.tutorial-text .step-1').visible).eql(false)
|
||||
@@ -109,6 +127,7 @@ test('Play', async t => {
|
||||
|
||||
levelNumber++;
|
||||
//first Level
|
||||
await t.debug();
|
||||
await t.expect(Selector('.segment.segment-parent.rotate-90').nth(0).getStyleProperty('transform')).eql("matrix(0, 1, -1, 0, 0, 0)")
|
||||
.expect(Selector('.segment.segment-parent.rotate-90').nth(1).getStyleProperty('transform')).eql("matrix(0, 1, -1, 0, 0, 0)")
|
||||
.expect(Selector('.segment.segment-parent.rotate-270').getStyleProperty('transform')).eql("matrix(0, -1, 1, 0, 0, 0)")
|
||||
|
||||
Reference in New Issue
Block a user