Welcome to mirror list, hosted at ThFree Co, Russian Federation.

closeByNavigation.js « protractor « tests « ng-dialog « node_modules - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d84ebb69a1f574f0614a06826cc0cace80362ed7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
describe('ngDialog closeByNavigation', function () {

    it('should close on state change with legacy ui-router', function () {
        // Load page
        browser.get('http://localhost:3000/example/browser-back-button/index.html');

        // Click button to go to 'about' state
        element(by.css('[ui-sref=about]')).click();

        // Expect a visible dialog on the page
        var EC = protractor.ExpectedConditions;
        browser.wait(EC.visibilityOf(element(by.css('.ngdialog'))), 5000);

        // Go back to 'home' state
        browser.navigate().back();

        // Expect there's no visible dialog on the page
        browser.wait(EC.not(EC.presenceOf(element(by.css('.ngdialog')))), 5000);
    });

    it('should close on state change with legacy ui-router', function () {
        // Load page
        browser.get('http://localhost:3000/example/browser-back-button/ui-router-1.0.0-rc.1.html');

        // Click button to go to 'about' state
        element(by.css('[ui-sref=about]')).click();

        // Expect a visible dialog on the page
        var EC = protractor.ExpectedConditions;
        browser.wait(EC.visibilityOf(element(by.css('.ngdialog'))), 5000);

        // Go back to 'home' state
        browser.navigate().back();

        // Expect there's no visible dialog on the page
        browser.wait(EC.not(EC.presenceOf(element(by.css('.ngdialog')))), 5000);
    });

});