Multiple Environment | Playwright & Cucumber - Typescript | Part 7

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 87

  • @letcode
    @letcode  Год назад +3

    Code: github.com/ortoniKC/Playwright_Cucumber_TS

    • @kidvikvlogs
      @kidvikvlogs Год назад +1

      rest of the code also same for javascript

    • @kidvikvlogs
      @kidvikvlogs Год назад

      @letcode .we can use page.pause for debug .I tried

  • @andyshort9471
    @andyshort9471 Год назад +1

    Another incredible tutorial mate. Very helpful 🙂

  • @queryinfo9207
    @queryinfo9207 Год назад

    Thanks, Koushik for all the time and effort. Amazing tutorial.

  • @dev1mail508
    @dev1mail508 7 месяцев назад +2

    hi @Koushik, Thank you,
    How to change the browser type depending upon the pakage.json in report.ts file?

    • @letcode
      @letcode  7 месяцев назад +1

      You have to use the js config and read the environment variables, In the following videos I have a demo.

    • @dev1mail508
      @dev1mail508 7 месяцев назад

      @@letcode Thank you Koushik

  • @TestingNewTesting-p6u
    @TestingNewTesting-p6u 10 дней назад +1

    LetCode with Koushik, any idea why am I getting 0 scenario 0 steps. I follow exact step by step as you. I tried to resolve the issue via the cucumber.json and check all the file path but still no luck. Please, I need help as I think I have spent all day in resolving this issue. Any help from anyone would be appreciate.. Thanks in advance

    • @letcode
      @letcode  10 дней назад

      Pls check the following steps.
      Dry run should be false,
      Path is correct for required feature files and step definitions.
      Get the file path from vs code - right click on the file click copy relative path. Don't type.

  • @harishraghvan8309
    @harishraghvan8309 7 месяцев назад +1

    Hi Koushik,
    i tried to open two browser windows by adding parallel 2 as you shown but its opening empty tab in the same browser. it didn't open new browser window. what could be the reason?
    Regards,
    Ragav

    • @letcode
      @letcode  7 месяцев назад

      Is it working fine with one browser?

    • @harishraghvan8309
      @harishraghvan8309 7 месяцев назад

      @@letcode yea I can open one browser , couldn’t open two browser at the same time

  • @mshrihan
    @mshrihan 8 месяцев назад +1

    Hi Kousik , unable to run/debug cucumber through test runner(cucmber-js) - I am able to see list of features but unbale to run and debug

    • @letcode
      @letcode  8 месяцев назад

      Is there any error message? And dry run is set to false?

  • @ParkJimin_Saranghaee
    @ParkJimin_Saranghaee Год назад +1

    Hi koushik, how do we handle mobile devices in the browser manager and use them?

    • @letcode
      @letcode  Год назад

      You can change view port with in context option.

  • @macaroane
    @macaroane 4 месяца назад +1

    can you run test in paralel on twodiff browsers? say one instance of chromium and one of ff?

    • @letcode
      @letcode  4 месяца назад

      I doubt that, I have to give it a try

    • @macaroane
      @macaroane 4 месяца назад

      @@letcode would be nice to have only one report in the end, that's why I'm asking

  • @Gauravsharma-yi2dl
    @Gauravsharma-yi2dl 7 месяцев назад +1

    how can we open another chrome tab and perform action within step definition file ?

    • @letcode
      @letcode  7 месяцев назад

      It is a window handling concept, I have a video on page object model for this, you can use the same concept.

  • @salvadorortunoramirez5890
    @salvadorortunoramirez5890 Год назад +1

    Thank you for the videos, I just started with playwright, I would like to know how to add a configuracion file for deviceManager, like browserManager...

    • @letcode
      @letcode  Год назад

      You can use the json file to store all the configurations.

  • @sumitgoyal385
    @sumitgoyal385 6 месяцев назад +1

    "./node_modules/@types",
    "src/helper/types"
    sometimes we give path starting with dot(.) and in second one without dot ,dot represents curr directory ,but why is it so ,WE DONT PUT LIKE ./src/helper/types ,PLS GUIDE
    #Iam using same project structure as yours

    • @letcode
      @letcode  6 месяцев назад

      Yes, ./ is required when accessing local files to specify that the file path is relative to the current directory. For built-in modules or packages from node_modules, simply use the module name without ./.

  • @blecomp
    @blecomp Год назад +1

    Hello again my friend. The suggestions doesn't work in my VSCode. Can you give an advice for fix this? Thanks

    • @letcode
      @letcode  Год назад +1

      Please check all the configuration again

  • @HariBaabu-dp1mf
    @HariBaabu-dp1mf Год назад

    Thanks Koushik

  • @Ashokkumar-uv4fs
    @Ashokkumar-uv4fs Год назад +1

    Hi Bro, I got this Error: function uses multiple asynchronous interfaces: callback and promise, How to fix this

    • @letcode
      @letcode  Год назад

      When u r getting this?

    • @Ashokkumar-uv4fs
      @Ashokkumar-uv4fs Год назад

      While running 12 th steps .(Then Verify that user should display with validation message when Click on Add button with NULL value
      When User enters more than of characters and User should be able view the validation character limit reached Message
      limit reached Message@@letcode

  • @vikabespyatova3312
    @vikabespyatova3312 Год назад +1

    Hi Koushik, thank you very much for your videos, it's very useful and interesting!🙂
    Unfortunatly, I'm just a beginner in playwright and automation and this is why I have one small question(
    So for this project is it possible to run tests at multiple browsers at the same time?

    • @letcode
      @letcode  Год назад +1

      Hi, not at the same time.
      Parallel execution possible but with a browser at a time.

    • @vikabespyatova3312
      @vikabespyatova3312 Год назад

      @@letcode Thanks😊

  • @lywatanak8594
    @lywatanak8594 Год назад +1

    Do have sample with javascript?

  • @cristhiamguerrero1700
    @cristhiamguerrero1700 Год назад +2

    I changed to this project structure managing environments, but the performance decreased, and now my scripts are not working, those are dying because of timeOut, why could it be?

    • @letcode
      @letcode  Год назад

      Managing the environment should not decrease the performance.
      Maybe your test application is slow,
      Try increasing the timeout.

    • @cristhiamguerrero1700
      @cristhiamguerrero1700 Год назад +1

      @@letcode Increased the time, but it seems was trouble with the bandwidth of internet, now is working fine :) after several times XD

  • @PraveenKumar-sk3rj
    @PraveenKumar-sk3rj Год назад +1

    Hi Koushik, recordings are really super useful, do you have similar topics covered in JS? getting 'please pass the browser value' error in JS when we pass environment variable as parameter

    • @letcode
      @letcode  Год назад

      Environment variable setting is the same for js and ts.
      Use gitbash.

  • @bhargavgurav3160
    @bhargavgurav3160 Месяц назад +1

    process.env is not working, i guess problem is in env.ts config path variable which also not working with templates

    • @letcode
      @letcode  Месяц назад

      I hope you're using git terminal?

    • @bhargavgurav3160
      @bhargavgurav3160 Месяц назад +1

      @@letcode now it is working, i don't know why but that env.baseurl was not getting ready to be used in login.ts file, when i tried it printing then it worked and now it is working suddenly. thank you for your reply. :)

    • @letcode
      @letcode  Месяц назад

      @bhargavgurav3160 magic is real 💪

  • @prajwalkore375
    @prajwalkore375 Год назад +1

    even though headless is true for you its launching chrome and firefox,I tried same for me as well,not sure whether luanch options for headless is working or not

    • @letcode
      @letcode  Год назад +1

      Yes, i have noticed it.
      It's not working, I'll update it in upcoming videos.

    • @shahwarfathima937
      @shahwarfathima937 Год назад +1

      @@letcode Is there any update on this? Even if I give false it is opening headless browser

    • @letcode
      @letcode  Год назад

      You pass that directly for now without function. I'll see.

  • @kidvikvlogs
    @kidvikvlogs Год назад +1

    How to use launch options for java script .kindly tell

    • @letcode
      @letcode  Год назад

      It will be the same. U have to not mention the type like : type

  • @AnUnprofessionalChef
    @AnUnprofessionalChef Год назад

    Thanks Kaushik🎉

  • @HariBaabu-dp1mf
    @HariBaabu-dp1mf Год назад +1

    Is there a way to read the channel from the env file ?

    • @letcode
      @letcode  Год назад

      Instead of browser make it as channel

  • @kidvikvlogs
    @kidvikvlogs Год назад +1

    How to handle ignore https error through cucumber with playwright ?

    • @kidvikvlogs
      @kidvikvlogs Год назад +1

      got it .😊by passing ignore https true in context of hooks page

    • @letcode
      @letcode  Год назад +1

      Awesome. I learnt this from u now.

  • @kidvikvlogs
    @kidvikvlogs Год назад +1

    How to implement traces ,debug , in playwright with cucumber? In normal playwright with mocha will do in playwright config file .kindly add your inputs

    • @letcode
      @letcode  Год назад

      Trace file i have already added.
      Debugging is not working I'm looking for alternate ways.

    • @manikanthnandikolla5240
      @manikanthnandikolla5240 Год назад +1

      @@letcodecan please give video link where you are added this traces file

    • @letcode
      @letcode  Год назад

      I'll update the code base.

  • @lrpbro6945
    @lrpbro6945 3 месяца назад

    Hii bro ,iam getting the browser as undefined when i pass through the .env

    • @letcode
      @letcode  3 месяца назад +1

      I hope you're using git bash as a terminal.

  • @kidvikvlogs
    @kidvikvlogs Год назад +1

    Even after adding complier options file not getting browser type in browser manager file .I am using through javascript 😊

    • @letcode
      @letcode  Год назад +1

      You won't get the types for js that's y I prefer the ts.

  • @venkateshtumpuru4
    @venkateshtumpuru4 3 месяца назад

    How can I run a scenario at a time in both chrome and firefox?

    • @letcode
      @letcode  3 месяца назад

      I don't think that is possible, at least with the setup we have.

  • @swapnilkude6472
    @swapnilkude6472 9 месяцев назад

    Hi Koushik,
    getting below error
    TypeError: Unable to require file: src\support\types\env.d.ts
    This is usually the result of a faulty configuration or import. Make sure there is a `.js`, `.json` or other executable extension with loader attached before `ts-node` available.
    could u help me pls?

    • @letcode
      @letcode  9 месяцев назад

      I hope you have watched the first video also, ts-node must be installed.

  • @sumitgoyal385
    @sumitgoyal385 6 месяцев назад

    import * as dotenv from 'dotenv'
    export const getEnv = () => {
    if (process.env.ENV) {
    dotenv.config({
    override: true,
    path: `src/helper/env/.env.${process.env.ENV}`
    })
    }else {
    console.error("NO ENV PASSED!")
    }
    }
    what will happen if I remove : override: true, is it mandatory ,I know overloading and overriding , but didnot got why we used it here pls guide ,you told in video I dont want to use my global things ,Iam not able to understand

    • @letcode
      @letcode  6 месяцев назад

      Override means , I want to use the local variables, those environment variables can be global as well.

    • @sumitgoyal385
      @sumitgoyal385 6 месяцев назад +1

      ok got it adding here for future reference :
      This code ensures that the environment variables defined in the .env file with the path constructed using process.env.ENV (e.g., .env.development or .env.production) take precedence over any identically named environment variables already set in the system(your laptop).

    • @letcode
      @letcode  6 месяцев назад

      @sumitgoyal385 yes correct

  • @swapnilbodade1336
    @swapnilbodade1336 9 месяцев назад

    Hi Koushik, Cucumber report is not getting generated, only first time it got generated

    • @swapnilbodade1336
      @swapnilbodade1336 9 месяцев назад +1

      I ran using gitbash then its working. Thanks for covering that too at end of the video

    • @letcode
      @letcode  9 месяцев назад

      Welcome 🤗

  • @urvashipunjabi9648
    @urvashipunjabi9648 Год назад

    can you please add logger functionality

  • @anjaliak5778
    @anjaliak5778 5 месяцев назад +1

    Getting an error in: npm i dotenv -D
    Like
    Code EAI_AGAIN
    syscall getaddrinfo
    errno EAI_AGAIN

    • @letcode
      @letcode  5 месяцев назад

      R u able to add other packages?

    • @anjaliak5778
      @anjaliak5778 5 месяцев назад +1

      It worked now

    • @letcode
      @letcode  5 месяцев назад

      Cool