I am trying to write a simple test using WebdriverIO on the SauceDemo website. When I insert valid authorization values in the inputs and then clear these inputs, it still somehow logs me in on a button click. Why am I getting logged in even though the input values are cleared?
My test script:
describe("test", () => {
it("should login to saucedemo", async () => {
await browser.url("https://www.saucedemo.com/");
const un = await $('[data-test="username"]');
await un.setValue("standard_user");
const pw = await $('[data-test="password"]');
await pw.setValue("secret_sauce");
await un.clearValue();
await pw.clearValue();
const lg = await $('[data-test="login-button"]');
await lg.click();
});
});
seems like the problem is not in the website, as the same script works like it should with playwright
New contributor
autojonski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.