Skip to content

Commit 66342e5

Browse files
authored
Merge pull request #674 from MetaCell/feature/netpyne-100
Feature/netpyne-100 PR
2 parents 5dea291 + f0e9272 commit 66342e5

69 files changed

Lines changed: 1890 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,135 @@ jobs:
5858
npm run Experiment_Manager_test
5959
env:
6060
CI: true
61+
Tutorial_1-SmokeTest:
62+
# The type of runner that the job will run on
63+
runs-on: ubuntu-20.04
64+
container: lironavon/docker-puppeteer-container:14.16.0
65+
env:
66+
CI: true
67+
steps:
68+
- uses: actions/checkout@v1
69+
- name: Use Node.js ${{ matrix.node-version }}
70+
uses: actions/setup-node@v1
71+
with:
72+
node-version: ${{ matrix.node-version }}
73+
cache-dependency-path: frontend/e2e/tests/package-lock.json
74+
- name: Tutorial 1 Plot Tests
75+
run: |
76+
cd tests/frontend/e2e
77+
#install dependencies
78+
npm ci
79+
# run Tutorial 1 Plot Tests
80+
npm run Tutorial_1_test
81+
env:
82+
CI: true
83+
Tutorial_2-SmokeTest:
84+
# The type of runner that the job will run on
85+
runs-on: ubuntu-20.04
86+
container: lironavon/docker-puppeteer-container:14.16.0
87+
env:
88+
CI: true
89+
steps:
90+
- uses: actions/checkout@v1
91+
- name: Use Node.js ${{ matrix.node-version }}
92+
uses: actions/setup-node@v1
93+
with:
94+
node-version: ${{ matrix.node-version }}
95+
cache-dependency-path: frontend/e2e/tests/package-lock.json
96+
- name: Tutorial 2 Plot Tests
97+
run: |
98+
cd tests/frontend/e2e
99+
#install dependencies
100+
npm ci
101+
# run Tutorial 2 Plot Tests
102+
npm run Tutorial_2_test
103+
env:
104+
CI: true
105+
Tutorial_3a-SmokeTest:
106+
# The type of runner that the job will run on
107+
runs-on: ubuntu-20.04
108+
container: lironavon/docker-puppeteer-container:14.16.0
109+
env:
110+
CI: true
111+
steps:
112+
- uses: actions/checkout@v1
113+
- name: Use Node.js ${{ matrix.node-version }}
114+
uses: actions/setup-node@v1
115+
with:
116+
node-version: ${{ matrix.node-version }}
117+
cache-dependency-path: frontend/e2e/tests/package-lock.json
118+
- name: Tutorial 3a Plot Tests
119+
run: |
120+
cd tests/frontend/e2e
121+
#install dependencies
122+
npm ci
123+
# run Tutorial 3a Plot Tests
124+
npm run Tutorial_3A_test
125+
env:
126+
CI: true
127+
Tutorial_3b-SmokeTest:
128+
# The type of runner that the job will run on
129+
runs-on: ubuntu-20.04
130+
container: lironavon/docker-puppeteer-container:14.16.0
131+
env:
132+
CI: true
133+
steps:
134+
- uses: actions/checkout@v1
135+
- name: Use Node.js ${{ matrix.node-version }}
136+
uses: actions/setup-node@v1
137+
with:
138+
node-version: ${{ matrix.node-version }}
139+
cache-dependency-path: frontend/e2e/tests/package-lock.json
140+
- name: Tutorial 3b Plot Tests
141+
run: |
142+
cd tests/frontend/e2e
143+
#install dependencies
144+
npm ci
145+
# run Tutorial 3b Plot Tests
146+
npm run Tutorial_3B_test
147+
env:
148+
CI: true
149+
Tutorial_3c-SmokeTest:
150+
# The type of runner that the job will run on
151+
runs-on: ubuntu-20.04
152+
container: lironavon/docker-puppeteer-container:14.16.0
153+
env:
154+
CI: true
155+
steps:
156+
- uses: actions/checkout@v1
157+
- name: Use Node.js ${{ matrix.node-version }}
158+
uses: actions/setup-node@v1
159+
with:
160+
node-version: ${{ matrix.node-version }}
161+
cache-dependency-path: frontend/e2e/tests/package-lock.json
162+
- name: Tutorial 3c Plot Tests
163+
run: |
164+
cd tests/frontend/e2e
165+
#install dependencies
166+
npm ci
167+
# run Tutorial 3c Plot Tests
168+
npm run Tutorial_3C_test
169+
env:
170+
CI: true
171+
Tutorial_4-SmokeTest:
172+
# The type of runner that the job will run on
173+
runs-on: ubuntu-20.04
174+
container: lironavon/docker-puppeteer-container:14.16.0
175+
env:
176+
CI: true
177+
steps:
178+
- uses: actions/checkout@v1
179+
- name: Use Node.js ${{ matrix.node-version }}
180+
uses: actions/setup-node@v1
181+
with:
182+
node-version: ${{ matrix.node-version }}
183+
cache-dependency-path: frontend/e2e/tests/package-lock.json
184+
- name: Tutorial 4 Plot Tests
185+
run: |
186+
cd tests/frontend/e2e
187+
#install dependencies
188+
npm ci
189+
# run Tutorial 4 Plot Tests
190+
npm run Tutorial_4_test
191+
env:
192+
CI: true

tests/frontend/e2e/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
"description": "NetPyNe UI tests",
55
"license": "unlicensed",
66
"scripts": {
7-
"test": "jest --verbose",
7+
"test": "jest --verbose ",
88
"EEG_Dipole_test": "jest --verbose EEG_and_Dipole_Tut#1 ",
99
"Experiment_Manager_test": "jest --verbose ExperimentManager_Tut#1 ",
10+
"Tutorial_1_test":"jest --verbose Tut#1_smoke ",
11+
"Tutorial_2_test":"jest --verbose Tut#2_smoke ",
12+
"Tutorial_3A_test":"jest --verbose Tut#3a_smoke ",
13+
"Tutorial_3B_test":"jest --verbose Tut#3b_smoke ",
14+
"Tutorial_3C_test":"jest --verbose Tut#3c_smoke ",
15+
"Tutorial_4_test":"jest --verbose Tut#4_smoke ",
1016
"lint": "eslint --fix --ext .js,.jsx ."
1117
},
1218
"dependencies": {

tests/frontend/e2e/tests/EEG_and_Dipole_Tut#1.test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,33 @@ beforeAll(async () => {
5858

5959
describe('EEG and Dipole Plot Test using Tutorial#1', () => {
6060

61+
it('Open new page', async () => {
62+
63+
console.log('Opening a new NetPyNE page')
64+
65+
await page.on("dialog", dialog =>
66+
dialog.accept());
67+
68+
await page.waitForSelector('#File', { timeout: PAGE_WAIT * 20 })
69+
await page.waitForTimeout(PAGE_WAIT * 6)
70+
await page.click('#File')
71+
await page.waitForSelector('#New', { timeout: PAGE_WAIT * 10 })
72+
await page.waitForTimeout(PAGE_WAIT)
73+
await page.click('#New')
74+
await page.waitForTimeout(PAGE_WAIT)
75+
await page.waitForSelector('#appBarPerformActionButton')
76+
await page.click('#appBarPerformActionButton')
77+
await page.waitForTimeout(PAGE_WAIT * 2)
78+
79+
await page.waitForFunction(() => {
80+
let el = document.querySelector('#loading-spinner');
81+
return el == null || el.clientHeight === 0;
82+
}, { timeout: TIMEOUT });
83+
84+
85+
await page.waitForSelector(selectors.SELECT_CELL_BUTTON_SELECTOR, { timeout: TIMEOUT * 10 })
86+
87+
})
6188

6289

6390
it('Load Tutorial#1', async () => {

tests/frontend/e2e/tests/ExperimentManager_Tut#1.test.js

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,35 @@ describe('Experiment Manager test using Tut#1', () => {
5858
}, { timeout: TIMEOUT });
5959
});
6060

61+
it('Open new page', async () => {
62+
63+
console.log('Opening a new NetPyNE page')
64+
65+
await page.on("dialog", dialog =>
66+
dialog.accept());
67+
68+
await page.waitForSelector('#File', { timeout: PAGE_WAIT * 20 })
69+
await page.waitForTimeout(PAGE_WAIT * 6)
70+
await page.click('#File')
71+
await page.waitForSelector('#New', { timeout: PAGE_WAIT * 10 })
72+
await page.waitForTimeout(PAGE_WAIT)
73+
await page.click('#New')
74+
await page.waitForTimeout(PAGE_WAIT)
75+
await page.waitForSelector('#appBarPerformActionButton')
76+
await page.click('#appBarPerformActionButton')
77+
await page.waitForTimeout(PAGE_WAIT * 2)
78+
79+
await page.waitForFunction(() => {
80+
let el = document.querySelector('#loading-spinner');
81+
return el == null || el.clientHeight === 0;
82+
}, { timeout: TIMEOUT });
83+
84+
85+
86+
await page.waitForSelector(selectors.SELECT_CELL_BUTTON_SELECTOR, { timeout: TIMEOUT * 10 })
87+
88+
})
89+
6190
it('Load Tutorial#1', async () => {
6291

6392
await page.waitForTimeout(PAGE_WAIT * 2)
@@ -66,7 +95,7 @@ describe('Experiment Manager test using Tut#1', () => {
6695
await click(page, selectors.TUTORIALS_BUTTON_SELECTOR, { timeout: TIMEOUT })
6796

6897
console.log('Tutorial #1')
69-
await click(page,selectors.TUTORIAL_1_SELECTOR, { timeout: TIMEOUT })
98+
await click(page, selectors.TUTORIAL_1_SELECTOR, { timeout: TIMEOUT })
7099
await page.waitForTimeout(PAGE_WAIT)
71100
await page.waitForSelector(selectors.PYR_CELL_SELECTOR)
72101
await page.waitForTimeout(PAGE_WAIT)
@@ -78,7 +107,7 @@ describe('Experiment Manager test using Tut#1', () => {
78107
it('Create network', async () => {
79108

80109
await page.waitForSelector(selectors.MODEL_BUTTON_SELECTOR)
81-
await click(page,selectors.MODEL_BUTTON_SELECTOR, { timeout: TIMEOUT });
110+
await click(page, selectors.MODEL_BUTTON_SELECTOR, { timeout: TIMEOUT });
82111
await page.waitForSelector(selectors.CREATE_NETWORK_SELECTOR)
83112
await click(page, selectors.CREATE_NETWORK_SELECTOR, { timeout: TIMEOUT });
84113

@@ -328,7 +357,7 @@ describe('Experiment Manager test using Tut#1', () => {
328357
await page.click(selectors.CONFIRM_SELECTOR)
329358

330359
await page.waitForFunction(() => !document.querySelector('tr[class="MuiTableRow-root"]'));
331-
360+
332361
})
333362

334363
});

0 commit comments

Comments
 (0)