Case: I want to loop through all the list(unable because I am using vue-virtual-scroll-list and elements are not visible anymore after a while)
I want to loop through a list of buttons with dynamic classes, click them and check if the class has changed.
fixtureThe Loop
.beforeEach(async (t) => { await t.useRole(loginUser); }) test ("Summary List check marks", async (t) => {
// const markStop = Selector('div.btn-group-y').find('[data-attribute="markStopBtn"]') await t.click(selector.driverReadyBtn);
let markStopBtn = await selector.markStopBtn let markStopBtnCount = await markStopBtn.count;
for(let i=0; i < markStopBtnCount; i++){ if(markStopBtn.nth(i).exists && markStopBtn.nth(i).visible) { await t .click(markStopBtn.nth(i)) // .expect(markStopBtn.withAttribute('class', 'btn-primary').exists).ok() } } });
Aucun commentaire:
Enregistrer un commentaire