Coder Social home page Coder Social logo

raptatinha / tau-advanced-playwright Goto Github PK

View Code? Open in Web Editor NEW
47.0 2.0 156.0 149 KB

Course Advanced Playwright by Renata Andrade for Test Automation University

Home Page: https://testautomationu.applitools.com/

License: MIT License

TypeScript 100.00%
playwright playwright-typescript test-automation-university testautomationuniversity testingwithrenata

tau-advanced-playwright's Introduction

Olá! Hi! 👋


🇧🇷

Eu sou a Renata Andrade, Software Quality Engineer, mineira e morando no Vale do Silício – Califórnia nos Estados Unidos.

Eu amo inspirar profissionais de TI em busca de fazer um trabalho melhor. E com mais de 18 anos de experiência com Tecnologia, estou aqui para compartilhar o que tenho experienciado de mais inovador.


🇺🇸

I'm Renata Andrade, Software Quality Engineer, Brazilian living in the Bay Area - California - USA.

I love inspiring IT professionals seeking for ways to improve their work. With over 18 years of experience in IT, I'm here to share the most innovative content I've experienced.


tau-advanced-playwright's People

Contributors

raptatinha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tau-advanced-playwright's Issues

storageState coming empty when authenticating via API

🐞 Describe the question:

Hello! Hope you are doing well! I've been stuck with the API authentication exercise. I'm using the demoqa.com site so I might be ignoring something.

This is what I have:

import { test as setup, type Page, chromium } from '@playwright/test';

const authFile = '.auth/api-admin.json';

setup('authenticate', async ({ request }) => {
  
  // Send authentication request. Replace with your own.
  await request.post('https://demoqa.com/Account/v1/GenerateToken', {
    form: {
      "email":"tau-admin",
      "password":"TestingWithR3n@t@"}
    });
  
  await request.storageState({ path: authFile });
});

This will pass and I get a 200 response, but for some reason, there's no cookies info in the json file. This is the resulting json file

{ "cookies": [], "origins": [] }

Checking the tracing I don't see any cookies in the response.

I already tried with the different APIs that are available in the Swagger doc, but I'm getting the same result. The APIs I tried are:
https://demoqa.com/Account/v1/Authorized
https://demoqa.com/Account/v1/GenerateToken
https://demoqa.com/Account/v1/Login

My guess is that I have to use the generated token, but not sure how to accomplish this or if this is the right approach.

Hope that you can help 😅 and thanks in advance!

🎡 A picture of your pet or a toy or something really cool:
image

[BUG]

🐞 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)

  1. Go to 'Terminal'
  2. run the command 'npx playwright test'
  3. tests don't start
  4. See error

🌵 Expected behavior:
Tests starts

📸 Screenshots/GIFs/Videos:
Capture d’écran (20)

💈 Dependencies' Version (please complete the following information):

  • OS: Windows 10
  • Browser Chromium
  • Playwright Version 1.35.1",
  • DotEnv Version 16.1.4
  • Applitools Version 1.17.5
  • VS Code Version 1.79.1
  • npm Version 9.5.1

🎡 A picture of your pet or a toy or something really cool:
🧪 🤟🏽

[BUG] Nothing works in this course

🐞 Describe the bug:
Tests fail
UI Mode does not open

👻 To Reproduce:
Follow the setup steps from the course (there are lots of gaps. test the course on several newbies before posting it)

🌵 Expected behavior:
Tests run and pass
UI Mode opens

📸 Screenshots/GIFs/Videos:
....npx playwright test --ui
Error: Timed out 5000ms waiting for expect(locator).toHaveURL(expected)

Locator: locator(':root')
Expected pattern: /.*profile/
Received string: "https://demoqa.com/login"
Call log:

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:\.......\tests\ui\pages\login-page.ts:34:29)
at globalSetup (C:\.......\tests\setup\global-setup.ts:15:19)

💈 Dependencies' Version (please complete the following information):

  • OS: Windows
  • Browser course default
  • Playwright Version 1.39
  • npm Version 10.2.0

🛝 Additional context:
I understand it's a free course but it's expected to teach student to use playwright, not to debug your course code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.