This repository has been archived by the owner on Sep 8, 2022. It is now read-only.
-
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.
Adds scaffolding for e2e tests (At this time Firefox only)
- Loading branch information
Showing
10 changed files
with
493 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const run = require('./run'); | ||
|
||
|
||
(async () => { | ||
await run('npm run build:dev'); | ||
process.chdir('dist'); | ||
await run('zip -r addon.xpi *'); | ||
process.chdir('../'); | ||
await run('npx jest --config jest.e2e.config.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,16 @@ | ||
const path = require('path'); | ||
const webdriver = require('selenium-webdriver'); | ||
const firefox = require('selenium-webdriver/firefox'); | ||
|
||
export default function beforeEachE2E() { | ||
const ffOptions = new firefox.Options() | ||
.headless() | ||
.setPreference('xpinstall.signatures.required', false) | ||
.setPreference('xpinstall.whitelist.required', false) | ||
.addExtensions(path.join(__dirname, '../dist/addon.xpi')); | ||
|
||
return new webdriver.Builder() | ||
.forBrowser('firefox') | ||
.setFirefoxOptions(ffOptions) | ||
.build(); | ||
} |
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,3 @@ | ||
// This file gets executed after jest | ||
// has started, see ../jest.e2e.conf.js | ||
jest.setTimeout(30000); // 30s |
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,12 @@ | ||
import beforeEachE2E from '../beforeEachE2E'; | ||
|
||
describe('SampleTest Suite', function() { | ||
let driver: any; | ||
|
||
beforeEach(() => driver = beforeEachE2E()); | ||
|
||
it('should run the test', async () => { | ||
await driver.get('https://www.faceit.com'); | ||
await driver.quit(); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -11,4 +11,4 @@ module.exports = { | |
"tsConfig": "tsconfig.content_scripts.dev.json" | ||
} | ||
} | ||
} | ||
}; |
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,16 @@ | ||
module.exports = { | ||
"roots": [ | ||
"<rootDir>/e2e/tests", | ||
], | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfig": "tsconfig.content_scripts.dev.json" | ||
} | ||
}, | ||
"setupFilesAfterEnv": [ | ||
"<rootDir>/e2e/init.ts", | ||
], | ||
}; |
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
Oops, something went wrong.