forked from LN-Zap/zap-desktop
-
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.
test(e2e): migrate e2e test suite to testcafe
- Loading branch information
Showing
18 changed files
with
1,595 additions
and
415 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,4 @@ | ||
{ | ||
"mainWindowUrl": "./app/dist/index.html", | ||
"appPath": "./app" | ||
} |
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
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 |
---|---|---|
|
@@ -32,7 +32,6 @@ install: | |
|
||
test_script: | ||
- yarn lint-ci | ||
- yarn build | ||
- yarn test-ci | ||
|
||
deploy_script: | ||
|
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,13 @@ | ||
/** | ||
* Build config for electron renderer process (e2e) | ||
*/ | ||
|
||
import merge from 'webpack-merge' | ||
import rendererProdConf from './webpack.config.renderer.prod' | ||
|
||
// Disable minification for compatibility with testcafe-react-selectors. | ||
export default merge.smart(rendererProdConf, { | ||
optimization: { | ||
minimizer: [] | ||
} | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { waitForReact } from 'testcafe-react-selectors' | ||
import { getBaseUrl, getPageTitle, assertNoConsoleErrors } from './utils/helpers' | ||
import Loading from './pages/loading' | ||
|
||
const loadingPage = new Loading() | ||
|
||
fixture('Onboarding') | ||
.page(getBaseUrl()) | ||
.beforeEach(async () => { | ||
await waitForReact() | ||
}) | ||
.afterEach(assertNoConsoleErrors) | ||
|
||
fixture('App') | ||
.page(getBaseUrl()) | ||
.beforeEach(async () => { | ||
await waitForReact() | ||
}) | ||
.afterEach(assertNoConsoleErrors) | ||
|
||
test('should open window and show loading screen', async t => { | ||
const { loadingBolt } = loadingPage | ||
|
||
await t | ||
.expect(getPageTitle()) | ||
.eql('Zap') | ||
.expect(loadingBolt.exists) | ||
.ok() | ||
}) |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ReactSelector } from 'testcafe-react-selectors' | ||
|
||
class Syncing { | ||
loadingBolt = ReactSelector('LoadingBolt') | ||
} | ||
|
||
export default Syncing |
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,9 @@ | ||
import { ReactSelector } from 'testcafe-react-selectors' | ||
|
||
class Syncing { | ||
loadingBolt = ReactSelector('LoadingBolt') | ||
syncing = ReactSelector('Syncing') | ||
qrcode = ReactSelector('QRCode') | ||
} | ||
|
||
export default Syncing |
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 { ClientFunction } from 'testcafe' | ||
|
||
export const getBaseUrl = () => '../../app/dist/index.html' | ||
|
||
export const getPageUrl = ClientFunction(() => window.location.href) | ||
|
||
export const getPageTitle = ClientFunction(() => document.title) | ||
|
||
export const assertNoConsoleErrors = async t => { | ||
const { error } = await t.getBrowserConsoleMessages() | ||
await t.expect(error).eql([]) | ||
} |
File renamed without changes.
Oops, something went wrong.