I need assistance with a unique task involving a series of buttons in my Intern functional test. Each button needs to be tested sequentially, but I'm not sure how to go about it. In my code snippet below, you can see the structure of my page:
<input type="button" text="Button 1" class="myBtn">
<input type="button" text="Button 2" class="myBtn">
<input type="button" text="Button 3" class="myBtn">
Here is the current approach in my test script:
return remote
.findAllByClassName('myBtn')
.then(function(btns) {
var btn1 = btns[0];
return btn1;
})
.click()
.end()
.then(function(btns) {
var btn2 = btns[1];
return btn2;
})
.click()
.end()
.then(function(btns) {
var btn3 = btns[2];
return btn3;
})
.click()
.end()
.end()
I am seeking guidance on the correct method for executing this iterative test using Intern.