Protractor : wait for element to become invisible/hidden

后端 未结 4 633
臣服心动
臣服心动 2021-01-01 15:04

I saw other protractor related post mentioning about how to wait for an element to become visible. However, recently, I ran into an opposite use case. I wanted to wait for a

4条回答
  •  生来不讨喜
    2021-01-01 15:50

    None of the solution working for me. Please take a look at below code:

    var protractor = require('protractor');
    
    describe('Testing', function () {
    it('Should show the settings button', function () {
        var EC = protractor.ExpectedConditions;
        var settings = $('.settings');
        var isSettingVisible = EC.visibilityOf(settings);
    
        browser.get('http://localhost:8080/#/edomonitor');
            console.log("--------------------welcome 1-------------------");
    
        protractor.browser.wait(isSettingVisible, 10000, "Searching for settings").then(() => {
           console.log("waiting complete");
        }, (error) => {
           console.log(error);
        })
        expect(2).toEqual(2);
     });
    });
    

提交回复
热议问题