How do I test if an img tag exists?

后端 未结 2 1190
无人及你
无人及你 2021-02-13 02:38

if I do expect(img).not.toBe(null) then I get an error: Error: expect called with WebElement argment, expected a Promise. Did you mean to use .getText()?

2条回答
  •  情深已故
    2021-02-13 02:52

    Using the latest Protractor build you can shorten it down to the following:

    expect(element(by.id('recaptcha_image')).isPresent()).toBe(true);
    

提交回复
热议问题