Nzira yekukudziridza bvunzo yekushandisa otomatiki Kubva Kubva!

Mune ino nhanho-nhanho nongedzo, ini ndichatsanangura maitiro ekuvandudza modularized Test Automation Framework kubva pakutanga uchishandisa Java, Selenium, TestNG neMaven.

Kutanga, ngatione kuti chii chinonzi Test Automation Framework uye ndeapi mabatsiro ekugadzira imwe.

Kwayedza Automation Sisitimu

Chii chiri chinangwa cheTest Automation Sisitimu? Ndeapi matambudziko aanogadzirisa echikwata chebudiriro?

Mukukudziridza agile, unogona kunge usina nguva yakaringana yekugadzirisa ako matsva maficha munguva, saka unogona kunge uchigadzira zvoga zvinyorwa, uchidzokorora yakawanda kodhi munzvimbo zhinji.

Kugadzirisazve kodhi chikamu chechisimba chekusimudzira software kudzivirira kuvaka chikwereti chakakura che tech. Izvi zvinoshandawo kuyedza otomatiki; nekumisazve zvinyorwa zvako zvoga, iwe uchavandudza kuverenga uye kugadzirisa mukufamba kwenguva.

Mune ino Yeyedzo Yekuzvimisikidza Sisitimu dzidziso, iyo yekupedzisira chigadzirwa mhedzisiro yezvakawanda zvinodzokorora nekufamba kwenguva. Zviripachena, kuramba uchivandudzika kwakakosha kana tichizowana kudzoka kwakanaka kune investment kubva test automation.



Kana tichigadzira Test Automation Framework, isu tinofanirwa kufunga zvinotevera zvinotevera pfungwa:

  • Kugona kugadzira otomatiki bvunzo nekukurumidza uchishandisa akakodzera mabviro matete
  • Sisitimu yacho inofanirwa kuve nekutema matanda zvine musoro uye chimiro chekuburitsa
  • Inofanirwa kuve nyore kugadziriswa uye kuwedzerwa
  • Inofanirwa kuve yakapfava zvakakwana kuti testers inyore zvoga zviedzo
  • Imwe nzira yekuedzazve kudzokorora bvunzo dzakundikana - izvi zvinonyanya kubatsira kuWebDriver UI bvunzo

Muchidzidzo ichi, ndichave ndichishandisa:

  • Java semutauro wekuronga
  • TestNG segadziriro yekusimbisa
  • Maven sechinhu chekuvaka
  • WebDriver seye browser yekushandisa chishandiso
  • IntelliJ seiyo IDE

Iyi Bvunzo Automation Sisitimu dzidziso yakakamurwa kuita zvikamu zviviri:

Chikamu 1: Kugadzira iyo yepasi purojekiti uye ma module uye kutsamira

Chikamu 2: Kuwedzera iyo kodhi

Muchikamu chekutanga cheiyi dzidziso ini ndinofungidzira kuti watove neJava neMaven yakaiswa pamushini wako.

Matanho ekugadzira Yedzo Yekushandisa otomatiki Sisitimu Kubva Kubva

Nhanho # 1 - Gadzira nyowani maven chirongwa

Vhura IntelliJ IDE uye sarudza Nyowani Project kubva kumenyu. Iwe unobva waunzwa nechiratidziro kusarudza mhando yeprojekti iwe yaunofarira.

Nhanho # 2 - Ipa yako projekiti zita

Sarudza Maven semhando yeprojekti. Ipa zita reGroupId uye ArtifatId - Ini ndafunga kutumidza iyi Test Automation Framework, Rima.

Nhanho # 3 - Sarudza nzvimbo yeprojekti yako

Zvino, sarudza zita reprojekti yako uye sarudza dhairekitori renzvimbo yako yekushandira

Nhanho # 4 - Base chirongwa chakagadzirwa

Iwe ikozvino une base base chirongwa chakagadzirwa. Tinogona kutanga kugadzira maven module muchirongwa ichi kuronga chimiro cheTest Automation Framework.

Uye aya ndiwo maitiro edu pom.xml anotaridzika

Sezvo ichi chichava chirongwa chedu chepasi nemubereki pom.xml, hatizove nekodhi muchirongwa ichi. Panzvimbo iyoyo, isu tichagadzira maven module ezvikamu zvakasiyana zveTest Automation Sisitimu. Enderera uye bvisa iyo src forodha.

Nhanho # 5 - Gadzira akasiyana ma module

Iye zvino isu tiri muchinzvimbo chekugadzira akasiyana maven ma module echimiro chedu. Isu tichagadzira anotevera ma module.

rima-framework - iyi module ine ese akanangana makirasi uye nzira dzekurerutsa kugadzira otomatiki bvunzo.

rima-domain - iyi module ine domain yakasarudzika mitauro (DSL) makirasi.

rima-peji-zvinhu - sekutaurwa kwazvinoitwa nezita, module iyi ine zvinhu zvepa peji.

rima-regression-bvunzo - uye pakupedzisira edu otomatiki ekudzokorora bvunzo.

Tichatanga nekugadzira iyo rima-framework module. Kuti uite izvi, sarudza Faira> Nyowani> Module

Sarudza Maven module uye tinya Next

Muchikero chinotevera, unogona kupa artifactId yemo module yauri kugadzira, mune ino kesi, rima-framework

Cherekedza iyo module yemubereki uye groupId seRima uye tinya Next kwatinogona kupa zita remu module uye tinya Pedza.

Kamwe rima-framework module yakagadzirwa, inofanirwa kutaridzika sechinhu chakadai

Tinogona kubva taenderera mberi nekugadzira mamwe ma module nenzira imwecheteyo. Kana tangogadzira ese ma module, chirongwa chedu chinofanira kutaridzika senge pazasi

Uye pakupedzisira, ese ma module akawedzerwa kumudzi pom.xml

Wedzera Kuvimbika

Tevere, isu tinofanirwa kuwedzera kutsamira pakati pemamojimendi mune fomati pamwe nekuwedzera maraibhurari uye mamwe maven mapurojekiti ayo Bvunzo Yedu Yekuzvimiririra inoenderana nayo.

Ini ndawedzera kutsamira mumafaira pom.xml. Unogona kutarisa kumafaira pom.xml mune yangu GitHub repo:

https://github.com/AmirGhahrai/Rima

Muchikamu chechipiri chedzidziso iyi, tichaenda kuburikidza neiyo chaiyo Test Automation Framework kodhi yakanyorwa muJava, WebDriver uye TestNG.

Uye, hechino chinongedzo cheChikamu chechipiri cheiyi dzidziso:

Peji Chinhu Chinhu Muenzaniso Sisitimu neJava uye WebDriver

Kuenderera mberi nekuverenga: