-
Notifications
You must be signed in to change notification settings - Fork 6
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
Integration tests #291
base: master
Are you sure you want to change the base?
Integration tests #291
Conversation
@deldesir can you review this❓ |
I am still at it. Will follow up ASAP. |
And you can just run headless: | ||
|
||
``` | ||
HEADLESS=false pytest -s |
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.
HEADLESS=false pytest -s
@thotmx is Line 175 supposed to be identical to Line 181?
(Can you clarify? If possible!)
# Fixture to save information to use through steps | ||
@pytest.fixture | ||
def step_context(): | ||
return {} |
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.
return {} | |
"""Fixture to save information to use through steps.""" | |
return {} |
@then('see the information for logged users') | ||
def _(browser): | ||
"""see the information for logged users""" | ||
assert browser.is_text_present('Books'), 'Book test' |
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.
Consider using a more descriptive error message
assert browser.is_text_present('Books'), 'Book test' | |
assert browser.is_text_present('Books'), 'Expected "Books" text to be visible on the home page' |
def _(browser): | ||
"""see the information for logged users""" | ||
assert browser.is_text_present('Books'), 'Book test' | ||
assert browser.is_text_present('Download to IIAB'), 'IIAB 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.
A more descriptive error message would be better here too
assert browser.is_text_present('Download to IIAB'), 'IIAB button' | |
assert browser.is_text_present('Download to IIAB'), 'Expected "Download to IIAB" button for logged users' |
Here is my approach for integration tests. The goal of this PR is to create a simple foundation to add integration tests for Calibre-web.
I left all the historical commits, so you can verify the different approaches for that.
Summary:
The whole IIAB testing would be better to setup in the IIAB project, or as a external project. But it would require setting up a CI infraestructure because the Github action constraints.
Technical part:
This approach uses:
Add a Github action workflow too.
Works with chrome browser and you can change an environment variable to verify the navigation (debugging) or use the headless approach.