Skip to content
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

Selenium Tests #162

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Selenium Tests #162

wants to merge 4 commits into from

Conversation

IMBCIT
Copy link
Contributor

@IMBCIT IMBCIT commented Jul 10, 2022

This is the first commit for adding Selenium tests to the front end. This test runs the SAM preset with a custom day count and process count sent by the user through cli args.

This version currently only supports Chrome and is using some Python 3.10+ only features, i.e. match case for the initial compare. This can be changed to if else statements to not break any compatibility with older versions. It is a rudimentary implementation of match and can be easily expanding upon.

Work for adding Firefox and Edge support are next.

Copy link
Collaborator

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments:

  • some xpaths are a bit too specific and will break easily if we change anything in the layout, so it's generally better to find a unique element (e.g. because of a class/id) near the one you want and then go from there, instead of starting from the root;
  • there are some wait/sleep that look a bit fragile: if the server takes longer the test will timeout and fail, if it takes less time it will wait for nothing. If possible it would be better to wait for the next page load (if selenium has such event) or possibly polling every few seconds.
  • there were a few style issues (e.g. lines too long, some spacing, string concatenation instead of f-string)

P.S.: using 3.10+ features is fine with me.

selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
selenium/selenium_simoc_test.py Outdated Show resolved Hide resolved
@ezio-melotti ezio-melotti added the enhancement A new enhancement or feature label Jul 17, 2022
=======
driver.find_element(By.ID, 'guest-login').click()

>>>>>>> Stashed changes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that some merge markers were accidentally committed (probably after a merge).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit after this one fixed this I believe.

8d33e2a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new enhancement or feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants