Skip to content

Commit 6a877b7

Browse files
authored
Fix #17 add project user test. (#19)
This adds a project user test to verify the working state of adding a user project relationship entry. Signed-off-by: David Brown <dmlb2000@gmail.com>
1 parent 75235d3 commit 6a877b7

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

tests/issue_17.test.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 Project User to show up in the drawer
12+
browser.waitForElementPresent('div[id=listitem-project-user]')
13+
// Click on the Project User text
14+
browser.click('div[id=listitem-project-user]')
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 Project ID
27+
browser.waitForElementPresent('input[id=modal-input-project]')
28+
// Enter a valid Project ID
29+
browser.setValue('input[id=modal-input-project]', '1235')
30+
// Wait for the window to render the input User ID
31+
browser.waitForElementPresent('input[id=modal-input-user]')
32+
// Enter a valid User ID
33+
browser.setValue('input[id=modal-input-user]', '11')
34+
// Wait for the window to render the input Relationship UUID
35+
browser.waitForElementPresent('input[id=modal-input-relationship]')
36+
// Enter a valid Relationship UUID (hard coded uuid of test relationship 2)
37+
browser.setValue('input[id=modal-input-relationship]', '69fb126a-a97a-4709-b9ce-58b3f84bdcb7')
38+
// Save the Project User entry
39+
browser.click('button[id=modal-button-save]')
40+
browser.pause(200)
41+
// Verify the Project User entry is in the table
42+
browser.expect.element('#root').text.to.contain('1235')
43+
browser.expect.element('#root').text.to.contain('11')
44+
browser.expect.element('#root').text.to.contain('69fb126a-a97a-4709-b9ce-58b3f84bdcb7')
45+
// Delete the entry we just put in
46+
browser.click('button[id=modal-button-delete-row-2]')
47+
browser.pause(100)
48+
// Wait for the confirm window to show up
49+
browser.waitForElementPresent('div[id=react-confirm-alert]')
50+
// Confirm we are deleting the right element
51+
browser.expect.element('#react-confirm-alert').text.to.contain('{"force":"True",')
52+
// Click on the 'Yes' button
53+
browser.click('div#react-confirm-alert button') // This should be the yes button
54+
browser.end()
55+
}
56+
}

0 commit comments

Comments
 (0)