Part1: WebdriverIO with TypeScript - SetUp
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
Thank you so much sir for providing this WD Typescript series
Just doing my bit. Keep Learning
Where is hooks videos?
Your contents are very good.
Your work is amazing.. and your knowledge too. wanted just this! huge love!
Means a lot, thank you so much. Keep learning and sharing.
Great explanation, thank you sir.
Hello sir do you provide paid live classes for webdriverIO with typescript
Can you also provide a series on API automation using mocha, chai and supertest please?
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
also you can refer framework github.com/sadabnepal/SupertestJavaScriptMocha
Hi , Nice video....please upload other parts also ASAP.
Unable to make it for some days. Hopefully this weekend I will be able to create something.
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.
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
@@TestAutomationHub Hi thanks for the reply. I will check on this and get back to you.
Hi, Tutorial video about the WebdriveIO, Typescript with Mocha frame work. and Create first test
you can follow the video i have created for mocha with javascript. everything remains same except compiler selection.
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.
I had to change the tsconfig.json file target to this "target": "ES5" and it worked perfectly.
@@late3205 looks like new version changes have some broken code, hence the error. Glad you find the solution, keep learning.
Hi maximize window not working with edge.conf.js and firefox.conf.js
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
Hi sir, i am getting error “cannot find type definition for @wdio/sync”
If possible please reply ASAP. I need help in my project
which file you are getting this error? Also did you create project or working on some existing project
@@TestAutomationHub yes, its the existing framework. The error is in @types token in tsconfig.json
@@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
@@TestAutomationHub thank u for your help
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..
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
@@TestAutomationHub Thanks..it's resolved now.... after local path we need add crx file.. Which I downloaded I added..it's worked..
@@TestAutomationHub in Webdriverio Cucumber framework how to close browser on each scenaiores..
@@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()
},
@@TestAutomationHub Thanks a lot..I'll check on this
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
try using drag and drop function
@@TestAutomationHub yes first tried with drag ad drop,movetoElement not worked..
They have now introdued a 'all in one' command.. "npm run wdio ."- does a complete set up. no need to install cli or anything!
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.
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
follow below link to setup firefox
webdriver.io/docs/wdio-geckodriver-service
@@TestAutomationHub same document I have followed not sure whey am getting those error..
@@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/
Hello do you have any idea on how to run wdio in linux. It is taking windows by default.
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/
@@TestAutomationHub how about giving platform as windows in capabilities.
@@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.
@@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
I am running through codefresh it takes linux by default. I want to run it in windows everytime instead of linux.
when is the next tutorial?
Hopefully this weekend.
The setup is configured but never actually runs the test.
Not impressed.
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).
@@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?
@@PaulGrossmanTheDarkArtsWizard i will create videos after wdio v8 release with new changes
@TestAutomationHub
Thank you, with v8 now released Iam waiting patiently for your video.
@@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.
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,
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!
@@ravigunasekaran Thank you so much for post solution here. appreciate it.
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'
Hi Minakshi, looks like a bug in new version on wdio. you need to add below code inside cucumberOpts section
retry: 0,
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"]