'default' ].forEach(methodType => { test.page(BASE_PAGE + '?methodType=' + methodType + '&autoStart=startLeaderElection')('test(LeaderElection) with method: ' + methodType, async (t) => { console.log('##### START LeaderElection TEST WITH ' + methodType); const stateContainer = Selector('#state'); const value = await stateContainer.innerText; const iframeAmount = await Selector('#leader-iframes iframe').count; console.log('LeaderElection(' + methodType + ') still no success (' + iframeAmount + ' iframes left)');
'default' ].forEach(methodType => { test.page(BASE_PAGE + '?methodType=' + methodType + '&autoStart=startBroadcastChannel') await AsyncTestUtil.waitUntil(async () => { await assertNoErrors(t); const stateContainer = Selector('#state'); const exists = await stateContainer.exists; if (!exists) { console.log('stateContainer not exists'); console.log('stateContainer exists'); const value = await stateContainer.innerText;
describe('getUserName.js', () => { test('it returns a string when passed an object', () => { const name = getUserName({ first: 'Andy', last: 'Warhol' }); expect(name).toBe('Andy Warhol'); }); test('it returns a string when passed a string', () => { const name = getUserName('Andy Warhol'); expect(name).toBe('Andy Warhol'); }); });
test('should allow users to login and see their documents', async (browser) => { await login({ email: 'user+1@test.com', password: 'password', browser, }); await browser.expect(getPageUrl()).contains('/documents'); });
/** * Remove swag from the cart based on text or a number * * @param {number|string} needle * * @return {Promise<void>} */ removeSwag(needle) { return t.click(this.getSwagRemoveButton(needle)); }
test('Should click on main menu [Selector]', async t => { await t.click('body'); await clickOnMainMenuItem(['Test', 'Click']); await t.expect(checkMainMenuClicked()).ok(); });
test('Should retrieve main menu snapshot [Labels & Indexes]', async t => { let snapshot = await getMainMenuItem(['Test', 'New Menu']); await t.expect(snapshot.sublabel).eql('item 3'); snapshot = await getMainMenuItem(['Test', { label: 'New Menu', index: 2 }]); await t.expect(snapshot.sublabel).eql('item 4'); });
test('Should retrieve main menu snapshot [Labels & Indexes]', async t => { await t.rightClick('body'); let snapshot = await getContextMenuItem(['New Test']); await t.expect(snapshot.sublabel).eql('item 3'); snapshot = await getContextMenuItem([{ label: 'New Test', index: 2 }]); await t.expect(snapshot.sublabel).eql('item 4'); });
test('create second shopping list', async (t) => { await loginFirstUser(t) await waitSelector(t, 'ShoppingLists', Selector('.example-form-control')) await t.typeText( await Selector('.example-form-control'), 'Second Shopping List' ) await t.click(await Selector('button').withText('Add Shopping List')) await refreshAndWait(t, () => Selector('.shopping-list').count, 3) })
describe('parseMarkdown.js', () => { test('it returns HTML when passed a string of Markdown', () => { const html = parseMarkdown('### Testing\n**Markdown** is working.'); expect(html).toBe('<h3>Testing</h3>\n<p><strong>Markdown</strong> is working.</p>\n'); }); });
test('create first shopping list', async (t) => { await loginFirstUser(t) await waitSelector(t, 'ShoppingLists', Selector('.example-form-control')) await t.typeText( await Selector('.example-form-control'), 'First Shopping List' ) await t.click(await Selector('button').withText('Add Shopping List')) await refreshAndWait(t, () => Selector('.shopping-list').count, 2) })