Skip to content

Automation Testing for Website using Python Behave (cucumber) and Selenium Webdriver

Notifications You must be signed in to change notification settings

damarmustikoaji/mangga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mangga Python Selenium Behave ChromeDriver GeckoDriver

Automation Test Ralali.com

Automation test aplikasi e-commerce Ralali.com menggunakan behave untuk kerangka pengujian (testing framework), dan gherkin yang merupakan bahasa bisnis yang digunakan untuk menulis tes dengan cara yang mudah dibaca oleh manusia, serta bahasa pemrograman python untuk penulisan script fungsi. Ralali, Online B2B Marketplace yang memberikan kemudahan proses transaksi jual-beli melalui teknologi dan fitur yang dapat membantu Seller dan Buyer melakukan proses bisnis lebih mudah, aman, dan transparan.

Requirements

  • Python 3.7.1
  • Behave
  • Selenium Webdriver
  • Browser Chrome or ChromeDriver
  • Browser Firefox or GeckoDriver

OS

  • macOS Mojave 10.14 (already tested)
  • Linux
  • Windows

How to Use

  • Download (zip) atau git pull project automation test
  • Buka terminal
  • Masuk ke directory project
  • Check versi python (Minimal versi python 3) $ python3 --version, atau dan lakukan update versi bisa download disini
  • Buat virtual enviroment untuk project $ virtualenv -p python3 <namafoldervirtual> atau jika error coba pip install --upgrade virtualenv kemudian virtualenv -p python3 envname
  • Aktifkan folder virtual enviroment ``$ source /bin/activate```
  • Check library dan framework yang sudah terinstall pada virtual enviroment (before)
  • Install kebutuhan library dan framework untuk project $ pip list
  • Install behave, selenium webdriver, atau bisa install menggunakan file requirements.txt $ pip install -r requirements.txt
  • Check library dan framework yang sudah terinstall pada virtual enviroment (after) $ pip list
  • Ketik perintah $ behave pada terminal untuk run semua file scenario test
  • Ketik perintah $ behave -i features/[nama file].feature untuk run 1 file scenario test
  • Ketik perintah $ behave -f steps --dry-run features/ untuk melihat semua format scenario test dan step definitions
  • Ketik perintah $ behave --dry-run untuk melihat semua scenario test pada file .feature
  • Untuk deactive virtualenv $ deactivate

Create Scenario Test (.feature)

  • Buat file didalam folder features/ dengan format [nama file].feature
  • Ketik perintah $ behave -f steps --dry-run features/ untuk melihat semua format scenario test yang bisa digunakan
  • Format penulisan scenario
Feature: Login

  Scenario: Login Invalid
    Given I navigate to "https://ralali.com/"
    When I click Login

  Scenario: Login Valid
    Given ...
  • Kemudian run dengan ketik $ behave -i features/[nama file].feature file tersebut

Configuration

Browser
  • Buka file browser.py didalam folder features/
  • Download ChromeDriver disini dan pastikan versi browser di local sama dengan chromedriver versi
  • Download GeckoDriver disini
  • Buat folder diluar project driver/

Browser Configuration

Enviroment
  • Buka file enviroment.py didalam folder features/

About

Automation Testing for Website using Python Behave (cucumber) and Selenium Webdriver

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published