-
Notifications
You must be signed in to change notification settings - Fork 207
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
[BUG] #2
Comments
Hi @mahefasolofo , As per the error message, it's not finding the "password" variable. Let me know how it goes :) |
Thank you for your response.
Sorry I forgot to remove the word 'example' on the .env file.
But I have a new bug after that : tests don't want to start because I have
the error.
Error: Timed out 5000ms waiting for expect(received).toHaveURL(expected)
Expected pattern: /.*profile/
Received string: "https://demoqa.com/login"
Call log:
- locator._expect with timeout 5000ms
- waiting for locator(':root')
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
- locator resolved to <html>…</html>
- unexpected value "https://demoqa.com/login"
at tests\ui\pages\login-page.ts:34
32 |
33 | async checkLoggedIn() {
34 | await expect(this.page).toHaveURL(/.*profile/);
| ^
35 | await expect(this.page).toHaveTitle(/DEMOQA/);
36 | }
37 |
at LoginPage.checkLoggedIn
(C:\Users\ADMIN\Documents\00-codes\tau-advanced-playwright\tests\ui\pages\login-page.ts:34:29)
at globalSetup
(C:\Users\ADMIN\Documents\00-codes\tau-advanced-playwright\tests\setup\global-setup.ts:15:19)
I don't know if I have to send one other Bug report or it's ok?
Thank you,
Le ven. 25 août 2023 à 12:44, Renata Andrade ***@***.***> a
écrit :
… Hi @mahefasolofo <https://github.com/mahefasolofo> ,
As per the error message, it's not finding the "password" variable.
The test is getting the password from the .env file.
Could you please check your .env file and see if the password is there?
Here are the instructions
<https://github.com/raptatinha/tau-advanced-playwright#:~:text=IMPORTANT%3A%20Create%20your%20.env%20file%20following%20the%20.env.example.%20The%20APPLITOOLS_API_KEY%20is%20the%20only%20param%20you%27ll%20need%20to%20uptdate%20to%20your%20credentials.>
I left on the project setup to guide you.
Let me know how it goes :)
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOSTYWBJNLTFSYOHFLVBPZLXXBXYHANCNFSM6AAAAAA36E3AZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Mahefa Rasolofonirina
P: +261 3 <+261+33+29+731+07>2 07 130 09
E: ***@***.***
<https://mysignature.io/editor/?utm_source=freepixel>
|
@mahefasolofo |
It doesn't work.
How can I get the UserId ?
It's the information that I don't have.
Le ven. 25 août 2023 à 16:53, Renata Andrade ***@***.***> a
écrit :
… @mahefasolofo <https://github.com/mahefasolofo>
Probably the login is not happening.
Can you create a new account at "https://demoqa.com/login" and update
your .env file with your credentials?
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOSTYWA6QYIJKOO5Q5QDOUTXXCU7JANCNFSM6AAAAAA36E3AZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Mahefa Rasolofonirina
P: +261 3 <+261+33+29+731+07>2 07 130 09
E: ***@***.***
<https://mysignature.io/editor/?utm_source=freepixel>
|
I explain this in the first chapter: https://testautomationu.applitools.com/playwright-advanced/chapter1.1.html |
what command are you using to run the test (https://github.com/raptatinha/tau-advanced-playwright#run-the-project)? |
npm run test-ui-c
I already have all the information from DEMOQA
Le ven. 25 août 2023 à 17:22, Renata Andrade ***@***.***> a
écrit :
… what command are you using to run the test (
https://github.com/raptatinha/tau-advanced-playwright#run-the-project)?
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOSTYWDH6NVQ2PAC4Y5GTRLXXCYK5ANCNFSM6AAAAAA36E3AZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Mahefa Rasolofonirina
P: +261 3 <+261+33+29+731+07>2 07 130 09
E: ***@***.***
<https://mysignature.io/editor/?utm_source=freepixel>
|
I've commented out the 2 lines in checkLoggedIn() and the tests run.
I've checked with the command 'npx playwright test --ui' and it works.
I uncommented the 2 lines in checkLoggedIn() and the tests run and restart
the tests on the UI : It's work : we have the URL : '
https://demoqa.com/profile'
And I've closed the windows. I restart tests with the command 'test-ui-c'
: tests no longer work.
*Thanks for your help, I think this is a special case. I've had other
problems with Playwright (with other exercises, but I don't know where to
ask the questions).*
Le ven. 25 août 2023 à 17:22, Renata Andrade ***@***.***> a
écrit :
… what command are you using to run the test (
https://github.com/raptatinha/tau-advanced-playwright#run-the-project)?
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOSTYWDH6NVQ2PAC4Y5GTRLXXCYK5ANCNFSM6AAAAAA36E3AZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Mahefa Rasolofonirina
P: +261 3 <+261+33+29+731+07>2 07 130 09
E: ***@***.***
<https://mysignature.io/editor/?utm_source=freepixel>
|
This is really weird @mahefasolofo .. |
I have the same issue:
at tests\ui\pages\login-page.ts:29 27 | async doLogin(email: string, password: string) {
I pasted the content from example.env to the new .env file and replaced USERNAME and PASSWORD with the ones from my new profile on demoqa. The password in .env file is correct as well as the username. Where could it go wrong? Do I need to do anything extra to .env other than just creating it and copy-pasting the structure from example + changing username/password to mine? BTW I had half the tests red in the basic course as well, probably because something is commented out while it shouldn't or something is not updated |
Hi @CIALdev, I'm asking because the classes show the test execution isolated to exemplify each example (I'll send a PR later updating the readme to make it clear here too). The application we are using for this training doesn't deal well with multiple sessions (I mention this in some of the chapters), for this reason, we need to use ".only" for a few tests, or do some specific changes to run a test successfully. These tests are not meant to be run all together (due to the application limitation). Regarding the "UPD" you mentioned: The login locator is "this.userName = page.getByPlaceholder('UserName');" as you can see on file login-page.ts. I named the method "fillEmail" (on line 19 of the same file) but you can see it receives a string, which can be anything, and it will use what is passed as parameter for each test; for example, for the test login.spec.ts it will use "const userName = process.env.USERNAME!;" for the test "test( Let me know if you need more clarification on how locators are used, I can plan a webinar about it to help you understand better. I recommend you take a look at these 2 resources meanwhile: https://github.com/raptatinha/tau-introduction-to-playwright/blob/main/extra-resources/chapter1.MD and https://github.com/raptatinha/tau-introduction-to-playwright/blob/main/extra-resources/chapter2.MD. I'll check the Intro Course too and will get back to you ASAP. |
After you create your You should run My test runHere's what I ran, and the results for a comparison. I'll have a better understanding of needs fixing when I complete the course. This run was enough for me to know that I'm setup. // Create a `.env` file which has the same contents as `.env.example`
source .env
npm run test-ui-c |
@flynnbops I did what you mentioned regarding the env variables and it didn't work, but it made me check what was going on with my environmental variables and it seems every time I was executing a test, the username variable was overridden by a local variable (of course, as if we don't change the ENV variable, is going to take everything local) and that's why the login is not done, so maybe one solution would be to rename the USERNAME env variable with other name as EMAIL or something different....or another solution would be to discover what's the variable that your computer is overriding and create an account in demoqa with that user. |
🐞 Describe the bug:
When I try to run the tests, with the command 'npx playwright test' I have an error :
Error: locator.fill : value : expected string, got undefined
at tests\pages\login-page.ts:24
await this.password.fill(password) ;
👻 To Reproduce:
Steps to reproduce the behavior: (On the project code)
🌵 Expected behavior:
Tests starts
📸 Screenshots/GIFs/Videos:
💈 Dependencies' Version (please complete the following information):
🎡 A picture of your pet or a toy or something really cool:
🧪 🤟🏽
The text was updated successfully, but these errors were encountered: