-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added suite to test overlay page
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 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,24 @@ | ||
import DemoPage from './DemoPage'; | ||
|
||
export default class OverlaysPage extends DemoPage { | ||
static async get() { | ||
await browser.get('/demo/#/overlay'); | ||
return new OverlaysPage(); | ||
} | ||
|
||
get openModalButton() { | ||
return element(by.css('[ui-turn-on="modal1"]')); | ||
} | ||
|
||
get openOverlayButton() { | ||
return element(by.css('[ui-turn-on="modal2"]')); | ||
} | ||
|
||
get modalDialog() { | ||
return element(by.css('[ui-shared-state="modal1"]')); | ||
} | ||
|
||
get overlayDialog() { | ||
return element(by.css('[ui-shared-state="modal2"]')); | ||
} | ||
} |
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,33 @@ | ||
import OverlaysPage from './OverlaysPage'; | ||
|
||
describe('demo', function() { | ||
fdescribe('overlays page', function() { | ||
it('should show "Overlays" as title', async function() { | ||
let page = await OverlaysPage.get(); | ||
expect(await page.heading.getText()).toBe('Overlays'); | ||
}); | ||
|
||
it('should not show a modal by default', async function() { | ||
let page = await OverlaysPage.get(); | ||
expect(await page.modalDialog.isPresent()).toBe(false); | ||
}); | ||
|
||
it('should show a modal by clicking on show modal', async function() { | ||
let page = await OverlaysPage.get(); | ||
await browser.actions().mouseMove(page.openModalButton).click().perform(); | ||
expect(await page.modalDialog.isDisplayed()).toBe(true); | ||
}); | ||
|
||
it('should not show an overlay by default', async function() { | ||
let page = await OverlaysPage.get(); | ||
expect(await page.overlayDialog.isPresent()).toBe(false); | ||
}); | ||
|
||
it('should show an overlay by clicking on show overlay', async function() { | ||
let page = await OverlaysPage.get(); | ||
await browser.actions().mouseMove(page.openOverlayButton).click().perform(); | ||
expect(await page.overlayDialog.isDisplayed()).toBe(true); | ||
}); | ||
|
||
}); | ||
}); |