Part1: WebdriverIO with TypeScript - SetUp

Sdílet
Vložit
  • čas přidán 23. 08. 2024
  • #webdriverio #typescript #cucumber #nodejs #beginners #webdriveriocucumber
    In this video, We will explore official documentation and setup webdriverio.
    In this tutorial series, we will be building a fully functional test automation framework in TypeScript using WebdriverIO and integrate our tests with Cucumber, Allure Report.
    -----------------------
    Important Link:
    -----------------------
    WebdriverIO official website: webdriver.io/
    Learn TypeScript Basics: • TypeScript Tutorial fo...
    Visual Studio Code download: code.visualstu...
    NodeJS download: nodejs.org/en/...
    Thanks for watching

Komentáře • 82

  • @urmilavadi4153
    @urmilavadi4153 Před 3 lety +1

    Thank you so much sir for providing this WD Typescript series

  • @AutmateTestingWithMe
    @AutmateTestingWithMe Před 28 dny

    Where is hooks videos?
    Your contents are very good.

  • @reachtosky942
    @reachtosky942 Před 2 lety

    Your work is amazing.. and your knowledge too. wanted just this! huge love!

  • @erdemore8629
    @erdemore8629 Před 2 lety

    Great explanation, thank you sir.

  • @EnglishWithVaibhav
    @EnglishWithVaibhav Před 22 dny

    Hello sir do you provide paid live classes for webdriverIO with typescript

  • @niveditamirjikar409
    @niveditamirjikar409 Před 2 lety +1

    Can you also provide a series on API automation using mocha, chai and supertest please?

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      hey Nivedita, I have covered GET and POST call in same playlist part 7 and 8. concept remains same in mocha as well just the the code goes in it block instead of step definition. You can refer automation bro channel for complete playlist.
      czcams.com/play/PL6AdzyjjD5HDR2kNRU2dA1C8ydXRAaaBV.html

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      also you can refer framework github.com/sadabnepal/SupertestJavaScriptMocha

  • @SukoonLakeeroMe
    @SukoonLakeeroMe Před 3 lety

    Hi , Nice video....please upload other parts also ASAP.

    • @TestAutomationHub
      @TestAutomationHub  Před 3 lety

      Unable to make it for some days. Hopefully this weekend I will be able to create something.

  • @sravanthik237
    @sravanthik237 Před 2 lety +1

    Hi I am struggling to automate system file upload functionality into the browser's hidden input. The wdio api "browser.file()" method is not successful ly uploading the file. Could you please let me know if it's possible to add 3rd party dependencies like robot or autoit frameworks into the webdriverio project so that I can try using the external APIs to get my requirement done.

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      Hi Sravanthi, leaving link of 'Automation Bro' channel who has pretty good content related to webdriverio and has also covered hidden file upload. let me know if this doesn't help.
      czcams.com/video/UC8fkpnO2cg/video.html

    • @sravanthik237
      @sravanthik237 Před 2 lety +2

      @@TestAutomationHub Hi thanks for the reply. I will check on this and get back to you.

  • @thirukumaranramanujam7330

    Hi, Tutorial video about the WebdriveIO, Typescript with Mocha frame work. and Create first test

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      you can follow the video i have created for mocha with javascript. everything remains same except compiler selection.

  • @late3205
    @late3205 Před 2 lety +1

    Hi, I followed your video step by step but when I finish configuring the project, the wdio.conf.ts and tsconfig.json files are saved in a folder called /tests and the wdio.conf.ts file gives me the following error in this line import type { Options } from "@wdio/types"; located in the wdio.conf.ts file
    *Cannot find module '@wdio/types'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option*
    Can you help me? Thank you very much in advance.

    • @late3205
      @late3205 Před 2 lety

      I had to change the tsconfig.json file target to this "target": "ES5" and it worked perfectly.

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      ​@@late3205 looks like new version changes have some broken code, hence the error. Glad you find the solution, keep learning.

  • @sudhasree6471
    @sudhasree6471 Před 2 lety

    Hi maximize window not working with edge.conf.js and firefox.conf.js

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      I have not covered other browser execution in this video so not sure if issue is related to the topic.
      First make sure you have service as selenium-standalone to use different browser. I have tried running maximize window with edge and it works for me. I need to know your configuration to see what exact issue is. Please join telegram group if possible and post query with screenshots t.me/webdriverio

  • @komalkaur3876
    @komalkaur3876 Před 3 lety

    Hi sir, i am getting error “cannot find type definition for @wdio/sync”
    If possible please reply ASAP. I need help in my project

    • @TestAutomationHub
      @TestAutomationHub  Před 3 lety

      which file you are getting this error? Also did you create project or working on some existing project

    • @komalkaur3876
      @komalkaur3876 Před 3 lety

      @@TestAutomationHub yes, its the existing framework. The error is in @types token in tsconfig.json

    • @TestAutomationHub
      @TestAutomationHub  Před 3 lety +1

      @@komalkaur3876 try npm install @wdio/sync --save-dev (only if you want to use sync mode) if you are trying to write code in async then update tsconfig as in video

    • @komalkaur3876
      @komalkaur3876 Před 3 lety

      @@TestAutomationHub thank u for your help

  • @Kiran_gks
    @Kiran_gks Před 2 lety

    Hi..Please help on below query..
    How to add extension path in webdriverio..in document page i see below code
    extensions: [
    // Entry should be a base64-encoded packed Chrome app (.crx)
    require('fs').readFileSync('/absolute/path/app.crx').toString('base64')
    ]
    In absolute path i have giving my local extension path..its not taking.
    basically i have added one extensions in chrome..when am launching chrome browser manual the extension is working...but i run local my code that extension is not taking..

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      This is new to me as I have not worked with custom extension. I will suggest to post this query to webdriverio gitter channel. Link: gitter.im/webdriverio/webdriverio

    • @Kiran_gks
      @Kiran_gks Před 2 lety

      @@TestAutomationHub Thanks..it's resolved now.... after local path we need add crx file.. Which I downloaded I added..it's worked..

    • @Kiran_gks
      @Kiran_gks Před rokem

      @@TestAutomationHub in Webdriverio Cucumber framework how to close browser on each scenaiores..

    • @TestAutomationHub
      @TestAutomationHub  Před rokem

      @@Kiran_gks i don't think you can close but you can relaunch after each scnario with. Go to wdio config file and search for afterScenario section, you can add below code
      afterScenario: async function (world, result) {
      await browser.reloadSession()
      },

    • @Kiran_gks
      @Kiran_gks Před rokem +1

      @@TestAutomationHub Thanks a lot..I'll check on this

  • @Kiran_gks
    @Kiran_gks Před rokem

    Hi @Test Automation Hub .. am trying bring element up to down..for that am using browser.buttonDown(1); ..but its throwing error TypeError: browser.buttonDown is not a function..could please help on this

    • @TestAutomationHub
      @TestAutomationHub  Před rokem

      try using drag and drop function

    • @Kiran_gks
      @Kiran_gks Před rokem

      @@TestAutomationHub yes first tried with drag ad drop,movetoElement not worked..

  • @reachtosky942
    @reachtosky942 Před 2 lety

    They have now introdued a 'all in one' command.. "npm run wdio ."- does a complete set up. no need to install cli or anything!

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      Yeah right, that is from later version which i used in this video. I am planning to create new one with version 8 stable release.

  • @Kiran_gks
    @Kiran_gks Před 2 lety

    Hi,
    am trying to run testcases in firefox, hence i have updated in services: [[
    'geckodriver',
    ] and capabilities browse name: firefox..then when i trying to install "npm i geckodriver" am getting below error.
    501 error code ELIFECYCLE
    502 error errno 1
    503 error geckodriver@3.0.1 postinstall: `node index.js`
    503 error Exit status 1
    504 error Failed at the geckodriver@3.0.1 postinstall script.
    504 error This is probably not a problem with npm. There is likely additional logging output above.
    505 verbose exit [ 1, true ]
    As debug: removed node_modules, package-lock.json and reinstalled still same issue...only i need to use firefox browser

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety +1

      follow below link to setup firefox
      webdriver.io/docs/wdio-geckodriver-service

    • @Kiran_gks
      @Kiran_gks Před 2 lety

      @@TestAutomationHub same document I have followed not sure whey am getting those error..

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      @@Kiran_gks have you installed wdio-geckodriver-service ?
      command: npm install wdio-geckodriver-service --save-dev
      if you have done this then connect with on linked and will discuss, www.linkedin.com/in/sadabnepal/

  • @daszmithun
    @daszmithun Před 2 lety

    Hello do you have any idea on how to run wdio in linux. It is taking windows by default.

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety +1

      there is no separation of configuration for linux or machine. it works same way. But if you running in docker linux environment then you have to setup docker as service. check webdriver.io/docs/wdio-docker-service/

    • @daszmithun
      @daszmithun Před 2 lety

      @@TestAutomationHub how about giving platform as windows in capabilities.

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      @@daszmithun I have created frameworks without defining platform in capabilities as it is not mandate and it works on both machine. check my GitHub repo. you can find link in video description.

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      @@daszmithun we don't need to define platform, unless you have some specific reason to do so. I have never added platform and everything still works

    • @daszmithun
      @daszmithun Před 2 lety

      I am running through codefresh it takes linux by default. I want to run it in windows everytime instead of linux.

  • @mats_3D
    @mats_3D Před 3 lety

    when is the next tutorial?

  • @PaulGrossmanTheDarkArtsWizard

    The setup is configured but never actually runs the test.
    Not impressed.

    • @TestAutomationHub
      @TestAutomationHub  Před rokem

      Hi Paul, error might be due to version difference. I made this video last year with version 7.6 and the current version 7.25 got some structural changes. I would suggest to follow official document (I have covered the walk through for the same reason).

    • @PaulGrossmanTheDarkArtsWizard
      @PaulGrossmanTheDarkArtsWizard Před rokem

      @@TestAutomationHub Yes I was well aware that that this would not run.
      Do you have a video that shows how to resolve the configuration and run the sample?

    • @TestAutomationHub
      @TestAutomationHub  Před rokem +1

      @@PaulGrossmanTheDarkArtsWizard i will create videos after wdio v8 release with new changes

    • @kmekky3870
      @kmekky3870 Před rokem +1

      @TestAutomationHub
      Thank you, with v8 now released Iam waiting patiently for your video.

    • @PaulGrossmanTheDarkArtsWizard
      @PaulGrossmanTheDarkArtsWizard Před rokem

      @@TestAutomationHub Good luck there. I have tried for a week with Version 8.0 and have had nothing but issues. In fact my 7.0 projects have breaking changes when upgrading with node-check-updates (ncu). Worse the project lead can’t replicate my issues. But I have three defects written in their GitHub repo.

  • @ravigunasekaran
    @ravigunasekaran Před 2 lety +1

    Hi,
    I'm facing below issue. Can you help?
    ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialise "@wdio/cucumber-framework".
    [0-0] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/formatter/helpers/event_data_collector' is not defined by "exports" in C:\wdioTestProject
    ode_modules\@cucumber\cucumber\package.json
    Thanks,

    • @ravigunasekaran
      @ravigunasekaran Před 2 lety

      I resolved this issue, by uninstalling the node version (Node.js was 32 bit and my OS was 64bit OS-Windows) and re-installing latest version of node.js (64 bit). Issue resolved. Might be useful for others.
      Cheers!

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      @@ravigunasekaran Thank you so much for post solution here. appreciate it.

  • @minakshifarakate2673
    @minakshifarakate2673 Před 2 lety

    I followed same steps still facing issue in wedio.conf.ts file for cucumberOpts
    Property 'retry' is missing in type '{ require: string[]; backtrace: false; requireModule: undefined[]; dryRun: false; failFast: false; format: string[]; snippets: true; source: true; profile: undefined[]; strict: false; tagExpression: string; timeout: number; ignoreUndefinedDefinitions: false; }' but required in type 'CucumberOpts'.ts(2741)
    types.d.ts(91, 5): 'retry' is declared here.
    Options.d.ts(427, 5): The expected type comes from property 'cucumberOpts' which is declared here on type 'Config'

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      Hi Minakshi, looks like a bug in new version on wdio. you need to add below code inside cucumberOpts section
      retry: 0,

    • @TestAutomationHub
      @TestAutomationHub  Před 2 lety

      you have commented some issue related to steps undefined. as you pasted complete error youtube blocked it. Can't see the error now.
      you can check what is defined in require section of CucumberOpts in package json. make sure the path cover new steps as well.
      you can keep like belwo
      require: [".features/step-definitions/*.ts"]