-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,845 additions
and
37,677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture('New User').page('http://localhost:3000/'); | ||
|
||
test('Create an account', async t => { | ||
await t | ||
// automatically dismiss dialog boxes | ||
.setNativeDialogHandler(() => true) | ||
|
||
// go to signup page | ||
.click('a[data-testid="signup"]') | ||
|
||
// fill out form | ||
.click('input[placeholder="Email"]') | ||
.typeText('input[placeholder="Email"]', '[email protected]') | ||
.click('input[placeholder="First Name"]') | ||
.typeText('input[placeholder="First Name"]', 'Test') | ||
.click('input[placeholder="Last Name"]') | ||
.typeText('input[placeholder="Last Name"]', 'User') | ||
.click('input[placeholder="Password"]') | ||
.typeText('input[placeholder="Password"]', 'password') | ||
|
||
// click signup | ||
.click('button[data-testid="SignupButton"]') | ||
|
||
// login | ||
.click('input[placeholder="Email"]') | ||
.typeText('input[placeholder="Email"]', '[email protected]') | ||
.click('input[placeholder="Password"]') | ||
.typeText('input[placeholder="Password"]', 'password') | ||
|
||
// click login | ||
.click('button[data-testid="LoginButton"]'); | ||
|
||
// check that we are on the home page | ||
const homePage = Selector('div').withText('MAPcore Services'); | ||
await t.expect(homePage.exists).ok(); | ||
}); | ||
|
||
test('Approve new employee', async t => { | ||
await t | ||
// automatically dismiss dialog boxes | ||
.setNativeDialogHandler(() => true) | ||
|
||
// login | ||
.click('input[placeholder="Email"]') | ||
.typeText('input[placeholder="Email"]', '[email protected]') | ||
.click('input[placeholder="Password"]') | ||
.typeText('input[placeholder="Password"]', 'password') | ||
|
||
// click login | ||
.click('button[data-testid="LoginButton"]') | ||
|
||
// go to administration page | ||
.click('a[data-testid="admin"]') | ||
|
||
// go to users tab | ||
.click('a[data-testid="users"]') | ||
|
||
// approve all | ||
.click('button[data-testid="approveAllButton"]') | ||
|
||
// select dropdown in row with name "Test User" | ||
.click('div[data-testid="[email protected]"]') | ||
.typeText('div[data-testid="[email protected]"]', 'Yes') | ||
.pressKey('enter') | ||
|
||
// delete user | ||
.click('img[data-testid="[email protected]"]') | ||
.click(Selector('button').withText('Delete')); | ||
}); |
Oops, something went wrong.