I'm trying to use Roles for Testcafe. When I use a Role it does not bring me back to the specified fixture page. The docs say this is how it is supposed to work, but I cannot seem to get it working.
Goals:
- Use Role to login
- Return to page.libraryScreen once the Role is used.
Here is my code:
fixture`Library /all`.page(page.libraryScreen).beforeEach(async t => {
await t.useRole(page.adminUser);
});
test('Search Bar', async t => {
const searchIcon = Selector('div').withAttribute('class', 'CampaignsPage-fab1');
const microAppNameInput = Selector('input').withAttribute('placeholder', 'Search');
const microAppTitle = Selector('div').withAttribute('class', 'SetCard-title ').innerText;
const searchIconElement = searchIcon.with({ visibilityCheck: true })();
await t
.click(searchIconElement)
.typeText(microAppNameInput, testMicroAppTitle)
.expect(microAppTitle)
.eql(testMicroAppTitle);
});
Aucun commentaire:
Enregistrer un commentaire