You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
docs(page-objects.md): Refactor the existing Page Object example (#4576)
* Refactor the existing Page Object example
so that it will run as presented. Open possibilities for future work, carry the initial introduction over into a Page Object. Introduce `world`, etc.
To switch to Page Objects, the first thing you need to do is create a Page Object. A Page Object for ‘The Basics’ example on the angularjs.org homepage could look like this:
@@ -41,13 +41,16 @@ var AngularHomepage = function() {
41
41
returngreeting.getText();
42
42
};
43
43
};
44
+
module.exports=newAngularHomepage();
44
45
```
45
-
The next thing you need to do is modify the test script to use the PageObject and its properties. Note that the _functionality_ of the test script itself does not change (nothing is added or deleted).
46
+
The next thing you need to do is modify the test script to use the Page Object and its properties. Note that the _functionality_ of the test script itself does not change (nothing is added or deleted).
47
+
48
+
In the test script, you'll `require` the Page Object as presented above. The path to the Page Object _will be relative_ to your spec, so adjust accordingly.
46
49
47
50
```js
51
+
var angularHomepage =require('./AngularHomepage');
0 commit comments