From 4b9b4acf79ab6ad4a029f128d74389a614e03643 Mon Sep 17 00:00:00 2001 From: Belia Anton Date: Fri, 5 Apr 2024 11:12:25 +0300 Subject: [PATCH] add class Header PageObject ArticlePage --- src/pageObject.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/pageObject.js b/src/pageObject.js index 52ecb384..3a53c321 100644 --- a/src/pageObject.js +++ b/src/pageObject.js @@ -1,15 +1,39 @@ 'use strict'; class Header { - + get logo() { + return 'Conduit logo'; + } }; class PageObject { + constructor(url) { + this.url = url; + this.header = new Header(); + } + clickOnLogo() { + return 'Click on the ' + this.header.logo; + } }; class ArticlePage extends PageObject { + constructor(url, slug) { + super(url + slug); + this.slug = slug; + } + + get commentButton() { + return '[Publish comment] button'; + } + + clickOnCommentButton() { + return 'Click on the ' + this.commentButton; + } + assertPageOpened() { + return 'The ' + this.url + ' is opened'; + } }; module.exports = {