'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);
'default' ].forEach(methodType => { test.page(BASE_PAGE + '?methodType=' + methodType + '&autoStart=startBroadcastChannel')
test.disablePageReloads('Browse items inside listing', async t => { debugger const itemsCount = db.articles.length await t.expect(await page.fields.id.count).eql(itemsCount) await t.expect(await page.fields.title.count).eql(itemsCount) await t.expect(await page.fields.published_at.count).eql(itemsCount) })
test.disablePageReloads('Create article through form', async t => { debugger const typeOptions = { paste: true } await t.typeText(page.inputs.title, title, typeOptions) await t.typeText(page.inputs.teaser, teaser, typeOptions) await t.typeText(page.inputs.body, body, typeOptions) await t.typeText(page.inputs.published_at, publishedAt) await t.click(page.form.find('button[type=submit]')) await t.expect(page.title.innerText).eql(`Article #${db.articles.length + 1}`) })
test.disablePageReloads('Article can not be saved without title', async t => { debugger await t.selectText(page.inputs.title.find('input'), 0).pressKey('delete') await t.click(page.form.find('button[type=submit]')) await t.expect(Selector('#title-helper-text').innerText).eql('Title is required') })
test.disablePageReloads('Article can not be created without title', async t => { debugger await t.click(page.form.find('button[type=submit]')) await t.expect(Selector('#title-helper-text').innerText).eql('Title is required') })
test.disablePageReloads('ID input can not be edited', async t => { debugger await t.expect(page.inputs.id.find('input').hasAttribute('disabled')).ok() })