getgauge / taiko

A node.js library for testing modern web applications

Home Page:https://taiko.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Taiko/Gauge - The Header Basic Authorization is getting mixed with the form Login

jawaharsan opened this issue · comments

In Taiko/Gauge Framework, we try to implement Basic Authorization with Base64 encoding method to launch a website. It works fine. But, when we try to login as a user which is a form on the application flow, it is not getting logged in. When we do it manually, there is no issue.

The code is something like this.

goto(url,{headers:{'Authorization':'Basic <Base64encodedcreds>'}}) => This works well.
On the login page, I need to give the user name (EmailID) and password as below:

await write("EmailID", into(textBox{id:"IDValueEmail"}));
await write("Password", into(textBox{id:"IDValuePassword"}));
await evaluate($(customelocatorSignin), ele => ele.click());

I have the following questions:
How to overwrite the password set for the URL using headers? I am not able to login with the particular valid credentials as a user on the login page. It just stays on the same page without throwing any error. How to resolve this issue?

I would think you'd need to unset the headers before filling/submitting the form.

Though I'm not sure why you would need both basic auth and a form login? Wouldn't you use one or the other?