Skip to content

siabuba121/SeleniumTestingService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SeleniumTestingService

Small python library wchich uses selenium webdriver to perform tests on Bookstores

Basic use

#required files and objects
from TestingService import Browsers, TestingService, ScreenSize
from BookstoreActions import Bookstore,serwisy

#init TestingService
browsersList = [Browsers.Chrome.value]
test = TestingService(browsersList,ScreenSize.hd)

#prepare some test
#driver param is obligatory when passing test to TestingService
def test(driver):
  driver.get("www.google.pl")
  
  
#pass test to TestingService
test.fireTest(test1)

BookstoreActions

To use BookstoreAction static methods

from BookstoreActions import Bookstore
  • Login to bookstore
def test(driver):
    Bookstore.loginToBookstore(driver,service,username,password)
  • Try to download position from account on selected bookstore
def test(driver):
    Bookstore.loginToBookstore(driver,service,username,password)
    Bookstore.tryToDownloadPosition(driver, service, title, fileFormat)
  • Add giftcard by form in basket
def test(dirver):
     Bookstore.loginToBookstore(driver,service,username,password)
     Bookstore.tryToAddBonToBasket(driver,service,giftcardCode)
  • Add position to basket
def test(driver):
    #You can be logged in but you don't have to
    #Bookstore.loginToBookstore(driver,service,username,password)
    Bookstore.addPositionToBasket(driver, service, troya, format)
    #possible formats: ebook, druk, audiobook
  • Place order from basket
def test(driver):
    #Being logged is optional
    #Bookstore.loginToBookstore(driver, service,username,password)
    Bookstore.placeOrder(driver, service)
  • Check if search suggestions are working properly version
def test(driver):
    #search without callback
    Bookstore.searchForPositionMainPage(driver, service, searchPhrase)
    #Bookstore.searchForPositionMainPage(driver, service, searchPhrase,Bookstore.clickFromSuggestions,1) with callback and argument passed to callback
    #Bookstore.searchForPositionMainPage(driver, service, searchPhrase,Bookstore.clickFromSuggestions) witch callback and default param in callback

About

Just some classes for more friendly selenium testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages