Webdriverio Cannot read properties of undefined (reading 'waitForDisplayed')

Viewed 14

I am trying to enable by clicking the enable button when the input field is disabled and click disable button when the input field is enabled.

describe("Wait for Enabled", function(){

it('should wait for the input field to be enabled', () => 
{
    browser.url('https://the-internet.herokuapp.com/dynamic_controls')
    LoginPage.enableButton.waitForDisplayed()
    LoginPage.enableButton.click()
    LoginPage.inputEnabledField.waitForEnabled ({timeout: 4000})
    expect(LoginPage.inputEnabledField).toBeEnabled()
    expect(LoginPage.inputEnabledField).not.toBeDisabled()
    })

it('should wait for the input field to be disabled', () => 
{

    LoginPage.enableButton.waitForDisplayed()
    LoginPage.enableButton.click()
    LoginPage.inputEnabledField.waitForEnabled({ timeout: 4000, reverse: true})
    expect(LoginPage.inputEnabledField).toBeDisabled()
        })
})```
0 Answers
Related