Skip to content
Snippets Groups Projects
Commit eb0f51f3 authored by John Watkins's avatar John Watkins
Browse files

finished test suite for dashboard

parent 9f0bd9f5
No related branches found
No related tags found
2 merge requests!114LoggingService service class, new method to add a log to the "Logs" table when...,!111fixed superadmin issue
No preview for this file type
......@@ -16,7 +16,8 @@ class Dashboard:
self.testSearchByTermCorrectAmountOfResults,
self.testSearchByTermIgnoresCase,
self.testCanAddTagToSearch,
self.testSearchByTagReturnsCorrectAmount
self.testSearchByTagReturnsCorrectAmount,
self.testWhenStarPressedBusinessIsMovedToTop
]
def __str__(self):
......@@ -128,4 +129,23 @@ class Dashboard:
input()
#Favourite businesses
def testWhenStarPressedBusinessIsMovedToTop(self):
driver = startTest(self.options)
login(driver)
star = driver.find_element(By.XPATH, '//*[@id="business_card_container"]/div[1]/div[2]')
driver.execute_script("arguments[0].click();", star)
driver.refresh()
time.sleep(1)
results = driver.find_elements(By.CLASS_NAME, "reward_card")
try:
assert len(results) == 1
success("Pressing the star moves the icon to favourited")
self.passed += 1
except AssertionError:
error("Items do not move when favourited")
input()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment