This is a Pytest project dedicated to GraphQL component's functional tests. We test how the component behaves using real environments and services it interacts with.
- With
python
>v3.7.0
install all the packages listed in requirements.txt file; - Check pytest.ini to see all available markers and CLi options adopted by default;
- Run the suite:
$ pytest
- Use
-m
option for triggering the run of a specific test case(s) or a class(es):pytest -m conversations
;
The suite structure:
|-- Conversations module :
| |---- As a system, I want to create a conversation between users.
| |---- As a participant, I want to get all my conversations.
| |---- As a participant, I want to get a particular conversation.
|
|-- User Presence module:
| |---- As a logged-in user, I want to indicate that I am online.
| |---- As a logged-in user, I want to know when another user has an update on their presence.
| |---- As a system, I want to get a list of users with unread messages.
|...
- Schema validation: fetching the schema with gql client directly from the server (when introspection enabled);
- Data validation: checking that each field has the expected values (e.g. user data is as expected, etc.);
- Elapsed time assertion: checking the elapsed time is =< expected.