-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Incognito session #996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work and feature to be working with multiple browsers!
Before doing the technical review here are some API thoughts.
One use case for this feature is supporting different user roles in the same workflow. For e.g. consider a hypothetical admin and non admin system
- User logs in
- User requests creates and submits and item
- Admin logs in
- Admin approves the item
- Use checks if the item if approved
A readable api for this workflow would be
openBrowser({profile: ‘user’})
write("user", into(‘Username:’))
write("password", into(‘Password:’))
click(“Sign In”)
click(“Submit Item”)
openBrowser({profile: ‘admin’))
write(‘admin’, into(‘Username:’))
write(‘password’, into(‘Password:’))
click(“Sign In”)
click(‘approve’)
switchTo({profile: ‘user”)
text(“approved”).exists()
closeBrowser({profile: "user"})
closeBrowser({profile: "admin"})
Notice that there is no incognito mode. If the user wants to launch incognito mode it can be
openBrowser({profile: ‘user’, incognito: true})
This way the user can also pass arguments to openBrowser()
It's better not to have a seperate incognito mode api.
Does that make sense?
More details about profiles at #921
@zabil @negiDharmendra Can you please review now? Docstring is pending. |
It's better to handle support for profiles in another PR using the profile directory of chrome.
This opens a window by default. If the user wants to open it in incognito mode
For switching windows
For closing the window
A representative use case could look like
|
@zabil I have fixed all the feedbacks. |
}; | ||
|
||
if (targetUrl.includes('about:blank')) { | ||
newCritarget(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should await
newCritarget
|
For example
This is a warning and not an error. |
@zabil #996 (comment) we decided previosuly to open a new window with random name. I'm getting confused now. |
So sorry for the confusion. I did say that, but I did not consider the effect that it may have on the |
@zabil @Debashis9012 Please review. Fixed all the comments |
Address: #862 #921 #560
#818 (comment)