diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index def73e60..e8063274 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - node-version: [12.x] + node-version: [14.x] steps: - uses: actions/checkout@v2 diff --git a/package-lock.json b/package-lock.json index a71c18ac..b862b810 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { - "name": "js-task-boilerplate", + "name": "js-page-object", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "js-task-boilerplate", + "name": "js-page-object", "version": "1.0.0", "hasInstallScript": true, "license": "GPL-3.0", "devDependencies": { "@mate-academy/eslint-config": "*", - "@mate-academy/scripts": "^1.2.8", + "@mate-academy/scripts": "^1.7.9", "eslint": "^5.16.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-node": "^8.0.1", @@ -536,9 +536,9 @@ } }, "node_modules/@mate-academy/scripts": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.2.8.tgz", - "integrity": "sha512-MqvuqrG8UUzQkRc375ZUIOd23nJ0BYqae/Nn5t01aDutSqZnz1ye65W4sLHiSuQJGIuHRO0CEyJxAO72wX1efw==", + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.7.9.tgz", + "integrity": "sha512-TDtSLf9BVwkaib4xpMB8r8VA18N6ABRpePGxpqk+aYOHcXq1DFwrzqCbOW9LyrOxWbqLVJBhP5exEgFXiaWhfw==", "dev": true, "dependencies": { "@octokit/rest": "^17.11.2", diff --git a/package.json b/package.json index f61e4c6d..d1c1fb8d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "license": "GPL-3.0", "devDependencies": { "@mate-academy/eslint-config": "*", - "@mate-academy/scripts": "^1.2.8", + "@mate-academy/scripts": "^1.7.9", "eslint": "^5.16.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-node": "^8.0.1", diff --git a/src/pageObject.js b/src/pageObject.js index 52ecb384..b055fe0b 100644 --- a/src/pageObject.js +++ b/src/pageObject.js @@ -1,15 +1,35 @@ 'use strict'; class Header { - + constructor() { + this.logo = '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; + this.commentButton = '[Publish comment] button'; + }; + + clickOnCommentButton() { + return `Click on the ${this.commentButton}`; + } + assertPageOpened() { + return `The ${this.url} is opened`; + }; }; module.exports = {