Skip to content

Commit 75235d3

Browse files
authored
Fix #3 Add User Group Test (#15)
* Fix #3 Add User Group Test This adds a test to try and reproduce the issue #3. Signed-off-by: David Brown <dmlb2000@gmail.com> * Fix the right css selector Signed-off-by: David Brown <dmlb2000@gmail.com>
1 parent 5cad0cc commit 75235d3

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

tests/issue_3.test.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module.exports = {
2+
'Create a User Group entry': function (browser) {
3+
// Open up the browser to the website
4+
browser.url('http://localhost:8080')
5+
browser.pause(100)
6+
// Wait for the open drawer icon to show up
7+
browser.waitForElementPresent('button[id=header-open-drawer]')
8+
// Open the drawer
9+
browser.click('button[id=header-open-drawer]')
10+
browser.pause(100)
11+
// Wait for User Group to show up in the drawer
12+
browser.waitForElementPresent('div[id=listitem-user-group]')
13+
// Click on the User Group text
14+
browser.click('div[id=listitem-user-group]')
15+
browser.pause(100)
16+
// Wait for the close drawer icon to show up
17+
browser.waitForElementPresent('button[id=drawer-close-drawer]')
18+
// Close the drawer
19+
browser.click('button[id=drawer-close-drawer]')
20+
browser.pause(100)
21+
// Wait for the Create icon to show up
22+
browser.waitForElementPresent('button[id=modal-button-create]')
23+
// Click on the Create icon to show the window
24+
browser.click('button[id=modal-button-create]')
25+
browser.pause(100)
26+
// Wait for the window to render the input User ID
27+
browser.waitForElementPresent('input[id=modal-input-user]')
28+
// Enter a valid User ID
29+
browser.setValue('input[id=modal-input-user]', '10')
30+
// Wait for the window to render the input Group ID
31+
browser.waitForElementPresent('input[id=modal-input-group]')
32+
// Enter a valid Group ID
33+
browser.setValue('input[id=modal-input-group]', '1000')
34+
// Save the User Group entry
35+
browser.click('button[id=modal-button-save]')
36+
browser.pause(200)
37+
// Verify the User Group entry is in the table
38+
browser.expect.element('div.rt-tr-group:nth-child(2)').text.to.contain('10')
39+
browser.expect.element('div.rt-tr-group:nth-child(2)').text.to.contain('1000')
40+
// Delete the entry we just put in
41+
browser.click('button[id=modal-button-delete-row-1]')
42+
browser.pause(100)
43+
// Wait for the confirm window to show up
44+
browser.waitForElementPresent('div[id=react-confirm-alert]')
45+
// Confirm we are deleting the right element
46+
browser.expect.element('#react-confirm-alert').text.to.contain('{"force":"True","user":10,"group":1000}')
47+
// Click on the 'Yes' button
48+
browser.click('div#react-confirm-alert button') // This should be the yes button
49+
browser.end()
50+
}
51+
}

0 commit comments

Comments
 (0)