I am using Instagram to explain my scenario. I login with a testUser id in Instagram. I loop through a set of Instagram accounts (ex: https://www.instagram.com/some_page/). Such direct URL's are passed from a JSON file. I validate something on this page and move on to next page to perform same set of validations.
My problem here is, the login block is executed for each data. I am unable to give it in Fixture section. Is there anyway to keep the logged-in session intact when I move between pages.
Role code
const testUser = Role('https://www.instagram.com/accounts/login/', async t => {
/* some code */
}, { preserveUrl: true });
Fixture and BeforeEach:
fixture`Instaa Test`
.page`https://www.instagram.com/`
.before(async t => {
})
.beforeEach(async t => {
await t.setTestSpeed(0.3)
await t.useRole(testUser)
await t.maximizeWindow()
})
Test Block:
dataSet.forEach(data => {
test("Check Business Account", async t => {
await t.navigateTo(data.pageURL);
/* some code */
}
}