Skip to content

Commit 0b45439

Browse files
netpyne-123 snapshots, change in selectors and step to check the population number in the saved file
1 parent 698a0f8 commit 0b45439

4 files changed

Lines changed: 86 additions & 1 deletion

File tree

tests/frontend/e2e/tests/SaveOpenFile.test.js

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//IMPORTS:
22
import 'expect-puppeteer';
3-
import { click } from './utils';
43
import { toMatchImageSnapshot } from 'jest-image-snapshot'
54
expect.extend({ toMatchImageSnapshot })
65
const path = require('path');
@@ -27,6 +26,57 @@ const SNAPSHOT_OPTIONS = {
2726

2827
let r = (Math.random() + 1).toString(36).substring(2);
2928

29+
const EDITED_MODEL = `\"popParams\": {
30+
\"E2\": {
31+
\"cellType\": \"E\",
32+
\"numCells\": 5,
33+
\"yRange\": [
34+
100,
35+
300
36+
]
37+
},
38+
\"E4\": {
39+
\"cellType\": \"E\",
40+
\"numCells\": 5,
41+
\"yRange\": [
42+
300,
43+
600
44+
]
45+
},
46+
\"E5\": {
47+
\"cellType\": \"E\",
48+
\"numCells\": 5,
49+
\"ynormRange\": [
50+
0.6,
51+
1.0
52+
]
53+
},
54+
\"I2\": {
55+
\"cellType\": \"I\",
56+
\"numCells\": 5,
57+
\"yRange\": [
58+
100,
59+
300
60+
]
61+
},
62+
\"I4\": {
63+
\"cellType\": \"I\",
64+
\"numCells\": 5,
65+
\"yRange\": [
66+
300,
67+
600
68+
]
69+
},
70+
\"I5\": {
71+
\"cellType\": \"I\",
72+
\"numCells\": 5,
73+
\"ynormRange\": [
74+
0.6,
75+
1.0
76+
]
77+
}
78+
},`
79+
3080
//USERS:
3181
const USERNAME = `TestUser${r}`
3282
const PASSWORD = 'testpassword'
@@ -521,4 +571,38 @@ describe('Save / Open File testing', () => {
521571

522572
})
523573

574+
it('Check the edited Populations of the Saved Model', async () => {
575+
576+
console.log('Checking cfg.py saved model ...')
577+
578+
await page.waitForSelector('#pythonConsoleOutput')
579+
580+
const elementHandle = await page.waitForSelector(
581+
'#pythonConsoleFrame'
582+
);
583+
584+
const python_frame = await elementHandle.contentFrame();
585+
586+
await python_frame.waitForSelector('#ipython-main-app')
587+
588+
const code_lines = await python_frame.$$('div.inner_cell')
589+
590+
await code_lines[7].type('cat netParams.json ')
591+
592+
await page.keyboard.down('Shift');
593+
await page.keyboard.press('Enter');
594+
await page.keyboard.up('Shift');
595+
596+
await page.waitForTimeout(PAGE_WAIT * 3)
597+
598+
const cat_code_output = await python_frame.$$eval('div[class="output_subarea output_text output_stream output_stdout"]', cat_code_outputs => {
599+
return cat_code_outputs.map(cat_code_output => cat_code_output.innerText)
600+
})
601+
602+
expect(cat_code_output[8]).toContain(EDITED_MODEL)
603+
604+
})
605+
606+
607+
524608
})

tests/frontend/e2e/tests/selectors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export const BASE_PAGE_SELECTOR = '.NetPyNE-root-1'
33
export const TUTORIALS_BUTTON_SELECTOR = 'button[id = "Tutorials"]'
44
export const MODEL_BUTTON_SELECTOR = 'button[id="Model"]'
55
export const CREATE_NETWORK_SELECTOR = 'li[id="Create network"]'
6+
export const CREATE_AND_SIMULATE_NETWORK_SELECTOR = 'li[id="Create and simulate network"]'
67
export const SIMULATE_NETWORK_SELECTOR = 'li[id="Simulate network"]'
78
export const SIMULATE_TOP_RIGHT_BUTTON_SELECTOR = 'div[class="MuiButtonGroup-root MuiButtonGroup-contained"]'
89
export const SIMULATION_PAGE_SELECTOR = 'canvas'
42.8 KB
Loading
83.4 KB
Loading

0 commit comments

Comments
 (0)