From 19e8c07091a504511052b76df020545ffc18a75e Mon Sep 17 00:00:00 2001 From: Maksymm Date: Thu, 16 May 2024 12:10:26 +0300 Subject: [PATCH] task --- src/pageObject.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/pageObject.js b/src/pageObject.js index 52ecb384..c45b15ef 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(); + 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 = {