From 367c348b88d68c5489e345b1656a549ccf97e466 Mon Sep 17 00:00:00 2001 From: Maksym Akhtamov Date: Wed, 20 Mar 2024 13:33:22 +0200 Subject: [PATCH 1/2] Solution --- src/pageObject.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/pageObject.js b/src/pageObject.js index 52ecb384..cdb6698a 100644 --- a/src/pageObject.js +++ b/src/pageObject.js @@ -1,15 +1,36 @@ '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, new Header()); + this.url = url + slug; + } + get commentButton() { + return '[Publish comment] button'; + } + clickOnCommentButton() { + return 'Click on the ' + this.commentButton; + } + assertPageOpened() { + return 'The ' + this.url + ' is opened'; + } }; module.exports = { From f875dd31c5c9bab951c056f66cfb839a237c3cb5 Mon Sep 17 00:00:00 2001 From: Maksym Akhtamov Date: Wed, 20 Mar 2024 13:41:10 +0200 Subject: [PATCH 2/2] Deleted unnecessary code --- src/pageObject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pageObject.js b/src/pageObject.js index cdb6698a..d8976fee 100644 --- a/src/pageObject.js +++ b/src/pageObject.js @@ -19,7 +19,7 @@ class PageObject { class ArticlePage extends PageObject { constructor(url, slug) { - super(url, new Header()); + super(url); this.url = url + slug; } get commentButton() {