Skip to content

Commit 54e4ebd

Browse files
committed
Built test
1 parent 8778b01 commit 54e4ebd

File tree

5 files changed

+1344
-725
lines changed

5 files changed

+1344
-725
lines changed

.github/workflows/push.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
with:
5050
working-directory: website
5151
- name: Build website
52+
working-directory: website
5253
run: |
53-
cd website/
5454
yarn build
5555
mkdir testing
5656
mv build testing/jb2
@@ -93,6 +93,11 @@ jobs:
9393
yarn
9494
yarn e2e
9595
working-directory: component_tests/app-vite
96+
- name: Test desktop app
97+
run: |
98+
yarn build-electron:linux
99+
yarn webdriver-test
100+
working-directory: products/jbrowse-desktop
96101

97102
# Conditionally run the buildjbrowseweb job
98103
buildjbrowseweb:
@@ -111,23 +116,21 @@ jobs:
111116
uses: bahmutov/npm-install@3714964fb879ebbbc108e167f0f3a0c81ec075c9 # v1.10.10
112117
- name: Build project
113118
run: |
114-
echo $RELEASE_VERSION
115-
cd products/jbrowse-web/
116119
NODE_OPTIONS='--max-old-space-size=6500' yarn build
117-
cd ../../
120+
working-directory: products/jbrowse-web
118121
- name: Configure AWS credentials
119122
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
120123
with:
121124
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
122125
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
123126
aws-region: us-east-1
124127
- name: Copy branch build to S3
128+
working-directory: products/jbrowse-web
125129
run: |
126-
cd products/jbrowse-web/build && zip -r "jbrowse-web-$(echo ${{github.ref}} | cut -d '/' -f3-).zip" . && cd -
127-
cp products/jbrowse-web/build/test_data/config.json products/jbrowse-web/build/config.json
128-
aws s3 sync --delete --exclude="*.map" products/jbrowse-web/build s3://jbrowse.org/code/jb2/$(echo ${{github.ref}} | cut -d "/" -f3-)
130+
zip -r "jbrowse-web-$(echo ${{github.ref}} | cut -d '/' -f3-).zip" build .
131+
cp build/test_data/config.json build/config.json
132+
aws s3 sync --delete --exclude="*.map" build s3://jbrowse.org/code/jb2/$(echo ${{github.ref}} | cut -d "/" -f3-)
129133
aws cloudfront create-invalidation --distribution-id E13LGELJOT4GQO --paths "/code/jb2/$(echo ${{github.ref}} | cut -d "/" -f3-)/*"
130-
131134
- name: Build LGV
132135
run: |
133136
yarn storybook:build

products/jbrowse-desktop/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"repository": "https://github.com/GMOD/jbrowse-components.git",
1111
"scripts": {
1212
"start": "node scripts/start.js",
13+
"webdriver-test": "yarn wdio",
1314
"electron": "electron . --no-sandbox",
1415
"electron-ts": "tsc -b tsconfig.electron.json",
1516
"preelectron": "npm run electron-ts",

products/jbrowse-desktop/test/specs/test.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { browser } from '@wdio/globals'
33
describe('Electron Testing', () => {
44
it('should print application title', async () => {
55
const r = await browser.getTitle()
6-
expect(r).toBe('Electron')
6+
expect(r).toEqual('JBrowse')
77
})
88
})

products/jbrowse-desktop/wdio.conf.ts

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,8 @@ export const config: Options.Testrunner = {
88
// WebdriverIO supports running e2e tests as well as unit and component tests.
99
runner: 'local',
1010

11-
//
12-
// ==================
13-
// Specify Test Files
14-
// ==================
15-
// Define which test specs should run. The pattern is relative to the directory
16-
// of the configuration file being run.
17-
//
18-
// The specs are defined as an array of spec files (optionally using wildcards
19-
// that will be expanded). The test for each spec file will be run in a separate
20-
// worker process. In order to have a group of spec files run in the same worker
21-
// process simply enclose them in an array within the specs array.
22-
//
23-
// The path of the spec files will be resolved relative from the directory of
24-
// of the config file unless it's absolute.
25-
//
2611
specs: ['./test/specs/**/*.ts'],
27-
// Patterns to exclude.
28-
exclude: [
29-
// 'path/to/excluded/files'
30-
],
12+
3113
//
3214
// ============
3315
// Capabilities
@@ -50,15 +32,20 @@ export const config: Options.Testrunner = {
5032
// Sauce Labs platform configurator - a great tool to configure your capabilities:
5133
// https://saucelabs.com/platform/platform-configurator
5234
//
35+
//
36+
// If you have trouble getting all important capabilities together, check out the
37+
// Sauce Labs platform configurator - a great tool to configure your capabilities:
38+
// https://saucelabs.com/platform/platform-configurator
39+
//
40+
5341
capabilities: [
5442
{
5543
browserName: 'electron',
56-
// Electron service options
57-
// see https://webdriver.io/docs/desktop-testing/electron/configuration/#service-options
5844
'wdio:electronServiceOptions': {
59-
// custom application args
60-
appBinaryPath:
61-
'/home/cdiesh/src/jbrowse-components/products/jbrowse-desktop/node_modules/.bin/electron',
45+
// WebdriverIO can automatically find your bundled application
46+
// if you use Electron Forge or electron-builder, otherwise you
47+
// can define it here, e.g.:
48+
appBinaryPath: 'dist/linux-unpacked/jbrowse-desktop',
6249
},
6350
},
6451
],
@@ -70,7 +57,8 @@ export const config: Options.Testrunner = {
7057
// Define all options that are relevant for the WebdriverIO instance here
7158
//
7259
// Level of logging verbosity: trace | debug | info | warn | error | silent
73-
logLevel: 'info',
60+
logLevel: 'error',
61+
// logLevel: 'info',
7462
//
7563
// Set specific log levels per logger
7664
// loggers:
@@ -141,4 +129,15 @@ export const config: Options.Testrunner = {
141129
ui: 'bdd',
142130
timeout: 60000,
143131
},
132+
133+
// Hooks
134+
// afterTest: async () => {
135+
// // Close Electron window after each test
136+
// try {
137+
// const { browser } = await import('@wdio/globals')
138+
// await browser.closeWindow()
139+
// } catch (error) {
140+
// console.log('Could not close window:', error)
141+
// }
142+
// },
144143
}

0 commit comments

Comments
 (0)