-
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
1 parent
ec65a00
commit fd8b568
Showing
11 changed files
with
3,353 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: NodeJS Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22.x' | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: npm single |
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,3 +1,4 @@ | ||
*.orig | ||
reports | ||
node_modules | ||
.DS_Store |
This file was deleted.
Oops, something went wrong.
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,23 +1,22 @@ | ||
exports.command = function(callback) { | ||
var TestingBot = require("testingbot-api"); | ||
const TestingBot = require("testingbot-api"); | ||
|
||
var tb = new TestingBot({ | ||
const tb = new TestingBot({ | ||
api_key: process.env.TB_KEY, | ||
api_secret: process.env.TB_SECRET | ||
}); | ||
|
||
var sessionid = this.capabilities['webdriver.remote.sessionid'], | ||
const sessionid = this.capabilities['webdriver.remote.sessionid'], | ||
jobName = this.currentTest.name, | ||
passed = this.currentTest.results.testcases[jobName].failed === 0; | ||
|
||
|
||
console.log("TestingBotSessionId=" + sessionid); | ||
|
||
var self = this | ||
tb.updateTest({ | ||
'test[success]': passed, | ||
'test[name]': jobName | ||
}, sessionid, function () { | ||
self.end(callback) | ||
}, sessionid, () => { | ||
this.end(callback) | ||
}); | ||
}; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = { | ||
test_settings: { | ||
default: {}, | ||
env1: { | ||
desiredCapabilities: { | ||
"browserName": "Chrome", | ||
"browserVersion": "latest", | ||
"platformName": "Windows 11" | ||
} | ||
}, | ||
env2: { | ||
desiredCapabilities: { | ||
"browserName": "Firefox", | ||
"browserVersion": "latest", | ||
"platformName": "Windows 11" | ||
} | ||
}, | ||
env3: { | ||
desiredCapabilities: { | ||
"browserName": "Safari", | ||
"browserVersion": "17", | ||
"platformName": "macOS Sonoma" | ||
} | ||
} | ||
} | ||
}; |
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,9 +1,79 @@ | ||
module.exports = (function(settings) { | ||
if (process.env.SELENIUM_HOST) { | ||
settings.selenium.host = process.env.SELENIUM_HOST; | ||
const additonalEnvironments = require("./environments"); | ||
|
||
if (!additonalEnvironments.test_settings) | ||
additonalEnvironments.test_settings = {}; | ||
|
||
const testingBotOptions = { | ||
'tb:options' : { | ||
"build" : "nightwatch-example", | ||
"name" : "Nightwatch Example Test", | ||
"seleniumVersion" : "4.24.0", | ||
username: '${TESTINGBOT_KEY}' || 'YOUR_USERNAME', | ||
accessKey: '${TESTINGBOT_SECRET}' || 'YOUR_ACCESS_KEY', | ||
}, | ||
} | ||
|
||
const testingBot = { | ||
webdriver: { | ||
start_process: false, | ||
timeout_options: { | ||
timeout: 120000, | ||
retry_attempts: 3 | ||
}, | ||
keep_alive: true | ||
}, | ||
|
||
selenium: { | ||
host: 'hub.testingbot.com', | ||
port: 443 | ||
}, | ||
|
||
desiredCapabilities: { | ||
browserName: 'chrome', | ||
...testingBotOptions | ||
} | ||
if (process.env.SELENIUM_PORT) { | ||
settings.selenium.host = process.env.SELENIUM_PORT; | ||
} | ||
|
||
const nightwatchConfigs = { | ||
src_folders: ['tests'], | ||
custom_commands_path: 'custom_commands', | ||
output_folder: 'reports', | ||
live_output: true, | ||
|
||
test_settings: { | ||
default: { | ||
launch_url: 'https://nightwatchjs.org' | ||
}, | ||
|
||
"testingbot.chrome": { | ||
...testingBot, | ||
desiredCapabilities:{ | ||
browserName: 'chrome', | ||
...testingBotOptions | ||
} | ||
}, | ||
"testingbot.firefox": { | ||
...testingBot, | ||
desiredCapabilities:{ | ||
browserName: 'firefox', | ||
...testingBotOptions | ||
} | ||
}, | ||
"testingbot.edge": { | ||
...testingBot, | ||
desiredCapabilities:{ | ||
browserName: 'Edge', | ||
...testingBotOptions | ||
} | ||
} | ||
} | ||
return settings; | ||
})(require('./nightwatch.json')); | ||
} | ||
|
||
for (let key in additonalEnvironments.test_settings) { | ||
nightwatchConfigs.test_settings[key] = { | ||
...testingBot, | ||
...additonalEnvironments.test_settings[key] | ||
}; | ||
} | ||
|
||
module.exports = nightwatchConfigs; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.