-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user evaluation form tests #201
Conversation
|
||
|
||
def generate_random_link(): | ||
scheme = random.choice(["http", "https", " "]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it have an empty string? same with the extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because , i need generate valid link and invalid ,and then check in test ,if valid must button will clickable .
pages/evaluation.py
Outdated
from utils.utils import create_links, create_numbers | ||
|
||
|
||
class Login: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you implement the Login class in the evaluation page??
pages/evaluation.py
Outdated
# '/html/body/div[20]/div[1]/nav/div/div/a[5]' | ||
# "//a[contains(@href, '/dashboard')]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to review and clean the code from all the unused comments
tests/contest.py
Outdated
@pytest.fixture(name="browse", scope="function") | ||
def browsee(): | ||
"""Function to save driver fixture.""" | ||
driver = webdriver.Edge() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are u using Edge and not the chrome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just try another browser to check the VPN , i changed it .
wait = WebDriverWait(self.browser, 30) | ||
wait.until(EC.visibility_of_element_located(self.selected_user)) | ||
select_usered = self.browser.find_element(*Evaluation.selected_user) | ||
select_usered.click() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 lines could be shorter into 2 like
WebDriverWait(self.browser, 30).until(EC.visibility_of_element_located(self.selected_user))
self.browser.find_element(*Evaluation.selected_user).click()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split it into more lines because flake extension , need the line be less than 79 character.
tests/test_evaluation.py
Outdated
from pages.evaluation import Login, Evaluation | ||
|
||
|
||
def to_login(browse): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To_login isn't the best description maybe it would be better like before_test_setup, setup_for_test
tests/test_evaluation.py
Outdated
login_button = login_page.click_login_button() | ||
login_button.click() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why didn't u just click the button on the function itself and just call it here?
login_page.click_login_button()
def click_login_button(self):
self.browser.find_element(*self.login_button).click()
tests/test_evaluation.py
Outdated
to_login(browse) | ||
evaluation_page = Evaluation(browse) | ||
evaluation_page.click_dashboard_button() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that these lines (maybe more) are repeated in every test, so why not just call them once in the to_login function and return the object
So only this instead of the repeated 3 lines
evaluation_page = to_login(browse)
And add this to the to_login
evaluation_page = Evaluation(browse)
evaluation_page.click_dashboard_button()
return evaluation_page
No description provided.