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

feat: demo workspace e2e #3889

Merged
merged 6 commits into from
Nov 12, 2024
Merged

feat: demo workspace e2e #3889

merged 6 commits into from
Nov 12, 2024

Conversation

RODO94
Copy link
Contributor

@RODO94 RODO94 commented Oct 31, 2024

What does this PR do?

This PR follows on for demo workspace work here: https://trello.com/c/EfaEQRzK/2441-create-a-demo-workspace

I have written a suite of api-driven e2e tests to ensure demoUser restrictions and capabilities are maintained during future code changes.

Strategy

To ensure a future dev could understand the tests and the nuances around database permissions, I have explicitly written out what data should be in the database during the tests in the Given statements within the Background of the .feature file. With this, I am able to populate the db directly with the datatable information.

To support the range of scenarios and different situations, I have split out the .steps file out into background | navigation | verification with each file handling either the Given steps, the When steps, or the Then | But steps.

This felt better from a readability point of view as putting them all in the same file became unwieldy and collating When or Then conditions seem to abstract the point of some of the tests.

The helper.ts file contains a lot of GraphQL requests because I had to return specific data or send specific data and found the shared requests didn't give me enough control on things like id & creator_id. This is similar for the types like Flow etc.

Struggles

I did struggle a bit with the right design patterns here and thinking about what code should sit within which kind of step, what goes in a When compared with a Then but I hope my use of state helps this.

I seem to hit a randomly occurring error as well around the creation of flows, I couldn't pinpoint how it is happening or what is causing it. The addition or removal of a console.error seems to trigger the error sometimes, so I thought it may be a race condition around a Promise.all() but I couldn't root it out... if anyone finds something, let me know, for now it is all passing.

Copy link

github-actions bot commented Oct 31, 2024

Removed vultr server and associated DNS entries

add new scenarios to feature file

revert ui-driven test changes

update feature with new tests

add step structure and helper
add Given logic and alter jwt build for demoUser

lint fix

refine Given statements

add When steps

add Then steps

lint:fix

tidy verification and helper
@RODO94 RODO94 requested a review from a team November 11, 2024 15:14
@RODO94 RODO94 marked this pull request as ready for review November 11, 2024 15:14
refine race condition Promise.All

improve error catching on createFlow
fix MyMutation naming
Copy link
Contributor

@jamdelion jamdelion left a comment

Choose a reason for hiding this comment

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

Loved how you split the steps up into the different types - really clear to read through.

I've mainly added some wording/variable name change suggestions to make it even clearer!

@RODO94 RODO94 requested a review from jamdelion November 12, 2024 09:51
Copy link
Contributor

@jamdelion jamdelion left a comment

Choose a reason for hiding this comment

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

Great! ✨

@RODO94 RODO94 merged commit c0c3d6f into main Nov 12, 2024
12 checks passed
@RODO94 RODO94 deleted the rory/demo-e2e branch November 12, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants