End to End Test
Where is the document for End-to-End test?
Why did the DOM element not change after clicking it by using the .click() function to send a click command to WebDriver?
browser
.execute(
// this function is send to the browser and run in it, so it can not get any variable in you E2E test code.
// if it needs to use some values in your E2E test code, you should push them in a Array as the second param.
// it will receives these data sequentially as its parameters.
function(param1, param2) {
// 1. locate the DOM element
const div = document.getElementById(param1)
const switchBtn = div.getElementsByClassName(param2)[0]
// 2. use scrollIntoView to move the element to viewable area
switchBtn.scrollIntoView(true)
return
},
[param1, param2],
() => {
// do something else after running the JavaScript code
}
)How do I run a specific project?
Last updated
Was this helpful?