-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
37 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
{ | ||
"Module1TestData":{ | ||
"skill1":"playwright by testers talk", | ||
"skill2":"cypress by testers talk", | ||
"skill3":"javascript by testers talk", | ||
"skill4":"postman by testers talk", | ||
"skill5":"rest assured by testers talk", | ||
"skill6":"specflow by testers talk", | ||
"skill7":"easyrepro by testers talk", | ||
"skill8":"api testing by testers talk" | ||
}, | ||
"stageTestData":{ | ||
"skill1":"cypress by testers talk", | ||
"skill2":"playwright by testers talk", | ||
"skill3":"javascript by testers talk", | ||
"skill4":"postman by testers talk", | ||
"skill5":"rest assured by testers talk", | ||
"skill6":"specflow by testers talk", | ||
"skill7":"easyrepro by testers talk", | ||
"skill8":"api testing by testers talk" | ||
"module1": { | ||
"skill1": "Cypress by Testers Talk", | ||
"skill2": "playwright by testers talk", | ||
"skill3": "javascript by testers talk", | ||
"skill4": "postman by testers talk", | ||
"skill5": "rest assured by testers talk", | ||
"skill6": "specflow by testers talk", | ||
"skill7": "easyrepro by testers talk", | ||
"skill8": "api testing by testers talk" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
// Inlcude playwright module | ||
const { test, expect } = require('@playwright/test'); | ||
const fs = require('fs'); | ||
|
||
import { qaTestData } from "../test-data/qa/google.json"; | ||
import { stageTestData } from "../test-data/stage/google.json"; | ||
// import { qaTestData } from "../test-data/qa/google.json"; | ||
// import { stageTestData } from "../test-data/stage/google.json"; | ||
|
||
/** | ||
* Bakkappa N | ||
*/ | ||
class BaseTest { | ||
|
||
/** | ||
* | ||
* @param {import ('@playwright/test').Page} page | ||
*/ | ||
constructor(page) { | ||
|
||
// Init page object | ||
this.page = page; | ||
|
||
if (process.env.ENV == 'qa') { | ||
this.testData = qaTestData; | ||
} else { | ||
this.testData = stageTestData; | ||
} | ||
// Get test data | ||
const environment = process.env.TEST_ENV || 'qa'; | ||
const testDataFile = `./test-data/${environment}/google.json`; | ||
this.testData = JSON.parse(fs.readFileSync(testDataFile, 'utf8')); | ||
|
||
// if (process.env.ENV == 'qa') { | ||
// this.testData = qaTestData; | ||
// } else { | ||
// this.testData = stageTestData; | ||
// } | ||
} | ||
|
||
async goto() { | ||
await this.page.setViewportSize({ width: 1366, height: 728 }) | ||
await this.page.goto('https://www.google.com'); | ||
if (process.env.TEST_ENV == 'qa') { | ||
await this.page.goto('https://www.google.com'); | ||
} else { | ||
await this.page.goto('https://www.google.com'); | ||
} | ||
} | ||
} | ||
export default BaseTest; |