From d1f61bd12c52e8c6c4017e5b7077d298c00cc2f4 Mon Sep 17 00:00:00 2001 From: AnatoliiTsymbaliuk Date: Wed, 20 Mar 2024 18:48:38 +0200 Subject: [PATCH] Solution --- src/pageObject.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/pageObject.js b/src/pageObject.js index 52ecb384..fc6c965b 100644 --- a/src/pageObject.js +++ b/src/pageObject.js @@ -1,15 +1,37 @@ + '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); + 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 = {