-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle.page.js
45 lines (34 loc) · 1.07 KB
/
article.page.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const Page = require('./page');
class ArticlePage extends Page {
get inputTitle() {
return $('input[formcontrolname="title"]');
}
get inputAbout(){
return $('input[formcontrolname="description"]')
}
get inputBody(){
return $('textarea[formcontrolname="body"]')
}
get btnSubmit() {
return $('button[type="button"]');
}
async enterAbout(about){
await this.inputAbout.setValue(about);
}
async enterBody(body){
await this.inputBody.setValue(body);
}
async publishArticle (title) {
console.log('Create article with title: ' + title);
await this.inputTitle.setValue(title);
await this.btnSubmit.click();
}
async publishFullArticle (title, about, body) {
console.log('Create article with followings: ' + [title, about, body]);
await this.inputBody.setValue(body);
await this.inputAbout.setValue(about);
await this.inputTitle.setValue(title);
await this.btnSubmit.click();
}
}
module.exports = new ArticlePage();