mirror of
https://github.com/kevin-DL/ShortMe-URL-Shortener.git
synced 2026-01-11 19:14:29 +00:00
Initial commit
This commit is contained in:
29
app/tests/front_end_testing/result/result.py
Normal file
29
app/tests/front_end_testing/result/result.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from app.tests.utilities import selenium_utility
|
||||
import pyperclip as pc
|
||||
|
||||
|
||||
class Result(selenium_utility.SeleniumUtility):
|
||||
_url_input_locator = '//input[@id="copy-able"]'
|
||||
_copy_button_locator = '//button[@id="copy-btn"]'
|
||||
_total_clicks_url = '//a[@id="total-clicks-link"]'
|
||||
|
||||
def __init__(self, driver):
|
||||
self.driver = driver
|
||||
super().__init__(driver)
|
||||
|
||||
self.url_input = self.get_element(self._url_input_locator)
|
||||
self.copy_button = self.get_element(self._copy_button_locator)
|
||||
|
||||
def get_input_text(self):
|
||||
return self.get_element(self._url_input_locator).get_attribute('value')
|
||||
|
||||
def click_copy_button(self):
|
||||
self.copy_button.click()
|
||||
|
||||
def go_to_total_clicks(self):
|
||||
self.get_element(self._total_clicks_url).click()
|
||||
|
||||
@staticmethod
|
||||
def get_clipboard_content():
|
||||
text = pc.paste()
|
||||
return text
|
||||
Reference in New Issue
Block a user