Test angepasst
This commit is contained in:
parent
895cb36fea
commit
be130a99e8
@ -2,7 +2,9 @@ import {Selector} from 'testcafe';
|
||||
import {ClientFunction} from 'testcafe';
|
||||
|
||||
const goBack = ClientFunction(() => window.history.back());
|
||||
const testLocalStorageSet = ClientFunction((key, value) => { localStorage.setItem(key, value)});
|
||||
const testLocalStorageSet = ClientFunction((key, value) => {
|
||||
localStorage.setItem(key, value)
|
||||
});
|
||||
const replaceRandom = ClientFunction((sequence) => {
|
||||
window.index = 0;
|
||||
window.sequence = sequence;
|
||||
@ -17,11 +19,17 @@ async function beforeEachTest(t){
|
||||
// await replaceRandom();
|
||||
}
|
||||
|
||||
let isLocal = false;
|
||||
async function afterEachTest(t) {
|
||||
return await t.eval(() => indexedDB.deleteDatabase('wordRotator'));
|
||||
}
|
||||
|
||||
let isLocal = true;
|
||||
if (isLocal) {
|
||||
fixture`Play`
|
||||
.page`https://127.0.0.1/pwa/wordRotator/publicTest/`.beforeEach(async t => {
|
||||
await beforeEachTest(t);
|
||||
}).afterEach(async t => {
|
||||
await afterEachTest(t);
|
||||
});
|
||||
}
|
||||
else {
|
||||
@ -33,6 +41,8 @@ else {
|
||||
}).beforeEach(async t => {
|
||||
await beforeEachTest(t);
|
||||
await t.wait(20000);
|
||||
}).afterEach(async t => {
|
||||
await afterEachTest(t);
|
||||
});
|
||||
}
|
||||
|
||||
@ -159,7 +169,7 @@ test('Play', async t => {
|
||||
offsetY: 41
|
||||
})
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.ONE).find('div').withText('S'), 10, dragDimen, {
|
||||
offsetX: 64,
|
||||
offsetX: dragDimen,
|
||||
offsetY: 32
|
||||
})
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.TEN), dragDimen, 4, {
|
||||
@ -205,17 +215,17 @@ test('Play', async t => {
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.THREE))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.FOUR))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.FIVE))
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.SIX), 3, dragDimen, {
|
||||
offsetX: 86,
|
||||
offsetY: 133
|
||||
})
|
||||
// .drag(Selector('.segment-parent').nth(SEGMENT.SIX), 3, dragDimen, {
|
||||
// offsetX: 86,
|
||||
// offsetY: 133
|
||||
// })
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.THREE))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.FOUR))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.SEVEN))
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.SIX), 10, dragDimen, {
|
||||
offsetX: 60,
|
||||
offsetY: 137
|
||||
})
|
||||
// .drag(Selector('.segment-parent').nth(SEGMENT.SIX), 10, dragDimen, {
|
||||
// offsetX: 60,
|
||||
// offsetY: 137
|
||||
// })
|
||||
.expect(Selector('#won-text').visible).eql(true)
|
||||
.expect(Selector('#continue-button').visible).eql(true)
|
||||
.click(Selector('#continue-button'))
|
||||
@ -282,18 +292,17 @@ test('Play', async t => {
|
||||
offsetX: 50,
|
||||
offsetY: 73
|
||||
})
|
||||
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.SEVEN))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.THIRTEEN))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.TWO))
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.ELEVEN), 14, dragDimen, {
|
||||
offsetX: 55,
|
||||
offsetX: dragDimen,
|
||||
offsetY: 57
|
||||
})
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.ONE), 4, dragDimen, {
|
||||
offsetX: 50,
|
||||
offsetY: 73
|
||||
})
|
||||
// .drag(Selector('.segment-parent').nth(SEGMENT.ONE), 4, dragDimen, {
|
||||
// offsetX: 50,
|
||||
// offsetY: 73
|
||||
// })
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.THREE))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.EIGHT))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.SEVEN))
|
||||
@ -307,13 +316,13 @@ test('Play', async t => {
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.NINE))
|
||||
.click(Selector('.segment-parent').nth(SEGMENT.FOUR))
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.ELEVEN), 14, dragDimen, {
|
||||
offsetX: 55,
|
||||
offsetX: dragDimen,
|
||||
offsetY: 57
|
||||
})
|
||||
.drag(Selector('.segment-parent').nth(SEGMENT.ONE), 4, dragDimen, {
|
||||
offsetX: 50,
|
||||
offsetY: 73
|
||||
})
|
||||
// .drag(Selector('.segment-parent').nth(SEGMENT.ONE), 4, dragDimen, {
|
||||
// offsetX: 50,
|
||||
// offsetY: 73
|
||||
// })
|
||||
// .click(Selector('.segment-parent').nth(SEGMENT.THIRTEEN))
|
||||
.click(Selector('#help-button'))
|
||||
.wait(5000)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user