Skip to content
Snippets Groups Projects
Commit 0d4e2f0c authored by Ethan Allen-Harris's avatar Ethan Allen-Harris Committed by Ethan Allen-Harris
Browse files

added superadmin selenium test

parent 8f4ac46e
Branches
No related tags found
1 merge request!114LoggingService service class, new method to add a log to the "Logs" table when...
...@@ -17,7 +17,7 @@ class Stamps: ...@@ -17,7 +17,7 @@ class Stamps:
] ]
def __str__(self): def __str__(self):
return "Stamps" return "stamps"
def addStamp(self): def addStamp(self):
driver = startTest(self.options) driver = startTest(self.options)
......
from modules.navigation import *
from modules.main import *
from modules.navigation import *
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
import time
class SuperAdmin:
def __init__(self, options):
self.options = options
self.passed = 0
self.tests = [
self.swapAccount
]
def __str__(self):
return "Super Admin"
def swapAccount(self):
driver = startTest(self.options)
login(driver)
try:
driver.get(BASE_URL + "/settings")
superAdminTab = driver.find_element(By.XPATH, '/html/body/div/div[1]/div[2]')
superAdminTab.click()
time.sleep(1)
swapAccountBtn = driver.find_element(By.XPATH, '/html/body/div/main/section[2]/article/div[2]/span[1]/button')
swapAccountBtn.click()
time.sleep(1)
name = driver.find_element(By.XPATH, '/html/body/nav/div[2]/div[2]/div/a')
time.sleep(1)
assert name.text == 'Hi kerra!'
success("Successfully swapped account")
self.passed+=1
except NoSuchElementException:
error("Did not add Successfully swap account")
input()
...@@ -4,6 +4,7 @@ from suites.categorySelection import CategorySelection ...@@ -4,6 +4,7 @@ from suites.categorySelection import CategorySelection
from suites.dashboard import Dashboard from suites.dashboard import Dashboard
from suites.stamps import Stamps from suites.stamps import Stamps
from suites.nav import Nav from suites.nav import Nav
from suites.superAdmin import SuperAdmin
from modules.main import * from modules.main import *
import os import os
os.system('color') os.system('color')
...@@ -19,7 +20,8 @@ suites = { ...@@ -19,7 +20,8 @@ suites = {
"categorySelection":CategorySelection(options), "categorySelection":CategorySelection(options),
"nav":Nav(options), "nav":Nav(options),
"dashboard":Dashboard(options), "dashboard":Dashboard(options),
"stamps":Stamps(options) "stamps":Stamps(options),
"superAdmin":SuperAdmin(options)
} }
def runAllSuites(): def runAllSuites():
...@@ -44,4 +46,4 @@ def runSuite(name): ...@@ -44,4 +46,4 @@ def runSuite(name):
error("Suite does not exist") error("Suite does not exist")
#runAllSuites() #runAllSuites()
runSuite("stamps") runSuite("superAdmin")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment