Posts tagged with #page object pattern
So far, we’ve seen how to write functional tests using the WebDriverIO API directly. Let’s see what problems we may encounter with that and how the page object pattern comes to rescue. Our example functional tests work against Google’s homepage. One test verifies that the search text box exists and it’s visible. Another test types something into that search text box and performs the search. In order to identify the text box, we use the same selector,
input[name=q]. The problem starts here and it’s not unique to functional tests: it’s copy pasting around magic strings.