Reputation: 1088
I want to test the pages of my website application. However, I have a disclaimer page that needs to be accepted before you can access the actual application. Is there a way to execute a task (click the accept button in my case) before doing the tests.
Currently, all my tasks fail because they can't pass the page.
Thanks.
Upvotes: 3
Views: 168
Reputation: 1088
The code will look something like this:
fixture`testing BeforeEach functionality`
.meta('fixtureID', 'fix-0001')
.meta({ author: 'luka98v', creationDate: Date() })
.page`${url}`
.beforeEach(async t => {
const acceptButton = Selector('#accept-disclaimer')
await t
.click(acceptButton)
})
It works fine.
Upvotes: 1