-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci-visibility] Fix selenium when run outside of a supported test fra…
…mework (#4330)
- Loading branch information
1 parent
3f6ad7e
commit 8f9e558
Showing
3 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
integration-tests/ci-visibility/test/selenium-no-framework.js
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,30 @@ | ||
const { By, Builder } = require('selenium-webdriver') | ||
const chrome = require('selenium-webdriver/chrome') | ||
|
||
async function run () { | ||
const options = new chrome.Options() | ||
options.addArguments('--headless') | ||
const build = new Builder().forBrowser('chrome').setChromeOptions(options) | ||
const driver = await build.build() | ||
|
||
await driver.get(process.env.WEB_APP_URL) | ||
|
||
await driver.getTitle() | ||
|
||
await driver.manage().setTimeouts({ implicit: 500 }) | ||
|
||
const helloWorld = await driver.findElement(By.className('hello-world')) | ||
|
||
await helloWorld.getText() | ||
|
||
return driver.quit() | ||
} | ||
|
||
run() | ||
.then(() => { | ||
process.exit(0) | ||
}).catch((err) => { | ||
// eslint-disable-next-line no-console | ||
console.error(err) | ||
process.exit(1) | ||
}) |
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