e2e/test/pages/_page.js (view raw)
1exports.Page = class {
2 constructor(path) {
3 this._path = path
4 }
5
6 /**
7 * @return {string}
8 */
9 get path() {
10 return this._path
11 }
12
13 /**
14 * @param {string} path
15 */
16 set path(path) {
17 this._path = path
18 }
19
20 async open() {
21 return await browser.url(this.path)
22 }
23
24 /**
25 *
26 * @param {string} selector
27 * @return {Promise<void>}
28 */
29 async click(selector) {
30 const element = await $(selector)
31 await element.click()
32 }
33 /**
34 *
35 * @param {string} selector
36 * @return {Promise<void>}
37 */
38 async type(selector, value) {
39 const element = await $(selector)
40 await element.click()
41 element.addValue(value)
42 }
43}