-
-
Notifications
You must be signed in to change notification settings - Fork 742
fix: puppeteer basic auth fix #2178
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
fix: puppeteer basic auth fix #2178
Conversation
@@ -22,7 +22,7 @@ describe('Puppeteer - BasicAuth', () => { | |||
global.codecept_dir = path.join(__dirname, '/../data'); | |||
|
|||
I = new Puppeteer({ | |||
url: 'http://localhost:8000', | |||
url: siteUrl, |
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.
small fix for running tests (locally at least). I found that when running docker-compose run --rm test-helpers test/helper/Puppeteer_test.js
that using localhost
would error out with Error: net::ERR_CONNECTION_REFUSED at http://localhost:8000/basic_auth
Clones added
============
- test/helper/Puppeteer_test.js 2
See the complete overview on Codacy |
Thank you! |
we have #2178 to fix puppeteer helper, so this patch will be applied in Playwright as well.
* udpated changelog * initial Playwright implementation * (fix): add wait for actions call * (fix): more failed webapi tests * (test): trigger playwright tests on CI * (lint): please hound ^^ * (fix): remove wrongly use .only * (fix): setCookie method to parse param as array * (fix): change to setCookies * (fix): tabs tests * (fix): please hound * (fix): remove unused console.log * updated Playwright to make all tests pass * updated playwright tests to start a server * upated server start * Create playwright.md * (fix): update based on comments * add playwright option to init cmd * add option to show browser when initialising * (fix): basic auth we have #2178 to fix puppeteer helper, so this patch will be applied in Playwright as well. * enable describe('Playwright - BasicAuth') test * updated to playwright 0.10.0 * fixed tests, updated docs * updated docs * ported patch from #2181 Co-authored-by: Peter Nguyen Tr <peter.nguyentr@gmail.com>
Motivation/Description of the PR
Noticed an issue with basic auth in the puppeteer helper when running multiple sessions. The authentication would be sent in the first scenario, but in subsequent scenarios it wouldn't get sent.
Applicable helpers:
Webdriver
Puppeteer
Nightmare
REST
Appium
Protractor
TestCafe
Description of this PR, which problem it solves
I found that the
isAuthenticated
boolean wasn't getting reset tofalse
, so this adds that reset in_stopBrowser
. This also adds anawait
to theauthenticate
call so that it doesn't setisAutheticated
before successfully authenticating.Type of change
Checklist:
npm run docs
)npm run lint
)npm test
)