Skip to content

Add a cypress test for testing project basic operations: create, edit, delete - #3881

Merged
lorenzo-cavazzi merged 7 commits into
lorenzo/cypress-renku-2.0from
lorenzo/cypress-renku-2.0-project
Jan 31, 2025
Merged

lorenzo-cavazzi merged 7 commits into
lorenzo/cypress-renku-2.0from
lorenzo/cypress-renku-2.0-project

Conversation

@lorenzo-cavazzi

Copy link
Copy Markdown
Member

See title

/deploy renku-ui=lorenzo/cypress-renku-2.0-data-cy

fix #3880

@RenkuBot

Copy link
Copy Markdown
Collaborator

@lorenzo-cavazzi
lorenzo-cavazzi marked this pull request as ready for review January 29, 2025 12:15
@lorenzo-cavazzi
lorenzo-cavazzi requested a review from a team as a code owner January 29, 2025 12:15
@leafty leafty self-assigned this Jan 29, 2025
cy.getDataCy("project-visibility-public").click();
cy.getDataCy("project-description-input").type(projectDescription);
cy.getDataCy("new-project-modal").contains(
`The URL for this project will be renkulab.io/v2/projects/${username}/${projectPath}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh my, oh my, oh my, this is actually hard-coded 🙈 Ouch! 🤕

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove or comment this test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am checking to ensure we are showing the correct expected URL.
What would be a reasonable alternative here? Perhaps just /${username}/${projectPath}?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe test that for now and have a comment. Also, that URL WILL be different at the end of this build cycle.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, true. I made this more resilient to the URL changes and, following your other suggestion on dropping the matcher for new-project-modal, I now match the URL element more precisely 2061f52

@leafty leafty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for adding this! 👏

Some comments below.

@lorenzo-cavazzi

Copy link
Copy Markdown
Member Author

@leafty thank you for the review!
I implemented all the suggestions except the ones asking to check for the element text after getting it though getDataCy.
The reason is here #3881 (comment) . I'm happy to further discuss it offline if you disagree or prefer a different approach.

const username = user.username;
cy.getDataCy("navbar-new-entity").click();
cy.getDataCy("navbar-project-new").click();
cy.getDataCy("new-project-modal").should("exist");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From the data-cy conversation, I think we should instead check against the presence of a new project form and not a modal. The fact that the form is presented inside a modal is not important and could change (a page, an off canvas, etc.) but there should always be a data-cy=new-project-form element presented to the user.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this makes sense! I dropped the use of new-project-modal and match the form instead 2061f52

@leafty leafty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent 👌

@lorenzo-cavazzi
lorenzo-cavazzi force-pushed the lorenzo/cypress-renku-2.0 branch from aa689e2 to cbe29dc Compare January 31, 2025 13:31
@lorenzo-cavazzi
lorenzo-cavazzi force-pushed the lorenzo/cypress-renku-2.0-project branch from 2061f52 to ac463a6 Compare January 31, 2025 13:33
@lorenzo-cavazzi
lorenzo-cavazzi merged commit b0a62ab into lorenzo/cypress-renku-2.0 Jan 31, 2025
@lorenzo-cavazzi
lorenzo-cavazzi deleted the lorenzo/cypress-renku-2.0-project branch January 31, 2025 14:23
lorenzo-cavazzi added a commit that referenced this pull request Mar 4, 2025
* Add prettier and update linter configuration
* Fix setting up baseUrl when running on cli
* Test project basic operations: create, edit, delete (#3881, #3908)
* Test working on groups: create, edit, delete (#3883, #3908)
* Test project resources -- code, data, environments (#3894)
* Test search entities (#3904)
* Test anonymous users navigation (#3906)
* Test running sessions (#3912)
* Update the cypress tests readme file (#3884)
* Split v2 and legacy cypress tests, improve naming (#3926)

---------

Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>
Panaetius pushed a commit that referenced this pull request Mar 4, 2025
* chore: create release 0.65.0

* chore(ci): update renku actions to v1.14.0 (#3886)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* fix: update csi rclone to 0.3.6 (#3889)

* chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /cypress-tests (#3888)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /cypress-tests (#3840)

Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>

* Merge branch 'master' into release-0.65.0 (#3895)

* feat(helm): Make Jena passwords optional in values file.

This commit continues on the topic of making the definition
of the secrets in the values files optional, to simplify CI
deployments.

As previous similar commits this change supports:

- Existing deployments where the secret is defined will
keep working as usual

- New deployments where the secret is defined will keep
working as they did before this change

- New deployments where the secret is NOT defined will
get 2 random passwords which will be persisted across
upgrades/redeployments

The three scenarios have been manually tested.

* feat: Make Redis and OIDC client secrets optional.

These are the last two secrets that were needed to be generated
out-of-bands before deploying Renkulab.

Thus the `generate-values` script is not really necessary anymore
and in its place there is a `minimal-deployment` values file that
in a future commit will also be used as a base for CI deployments.

The documentation has been updated to reflect the removal of the
script.

Further cleanup and simplification of the Helm chart will result
in a smaller and simpler minimum-deployment file, with the ultimate
goal of being able to issue `helm install renku/renku` resulting
in a functioning development deployment.

* feat: Define some more sensible defaults.

* feat: Configure data-services to connect to solr (#3918)

* chore(ci): update renku actions to v1.14.1 (#3927)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* chore: update renku-ui to 3.47.0 (#3930)

* revert: Configure data services to connect to solr

Refs: e831264

* tests: add cypress tests for Renku 2.0 (#3879)

* Add prettier and update linter configuration
* Fix setting up baseUrl when running on cli
* Test project basic operations: create, edit, delete (#3881, #3908)
* Test working on groups: create, edit, delete (#3883, #3908)
* Test project resources -- code, data, environments (#3894)
* Test search entities (#3904)
* Test anonymous users navigation (#3906)
* Test running sessions (#3912)
* Update the cypress tests readme file (#3884)
* Split v2 and legacy cypress tests, improve naming (#3926)

---------

Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Alessandro Degano <[email protected]>
Co-authored-by: eikek <[email protected]>
Co-authored-by: Chandrasekhar Ramakrishnan <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
olevski added a commit that referenced this pull request May 13, 2025
* chore: create release 0.65.0

* chore(ci): update renku actions to v1.14.0 (#3886)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* fix: update csi rclone to 0.3.6 (#3889)

* chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /cypress-tests (#3888)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /cypress-tests (#3840)

Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](moxystudio/node-cross-spawn@v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>

* Merge branch 'master' into release-0.65.0 (#3895)

* feat(helm): Make Jena passwords optional in values file.

This commit continues on the topic of making the definition
of the secrets in the values files optional, to simplify CI
deployments.

As previous similar commits this change supports:

- Existing deployments where the secret is defined will
keep working as usual

- New deployments where the secret is defined will keep
working as they did before this change

- New deployments where the secret is NOT defined will
get 2 random passwords which will be persisted across
upgrades/redeployments

The three scenarios have been manually tested.

* feat: Make Redis and OIDC client secrets optional.

These are the last two secrets that were needed to be generated
out-of-bands before deploying Renkulab.

Thus the `generate-values` script is not really necessary anymore
and in its place there is a `minimal-deployment` values file that
in a future commit will also be used as a base for CI deployments.

The documentation has been updated to reflect the removal of the
script.

Further cleanup and simplification of the Helm chart will result
in a smaller and simpler minimum-deployment file, with the ultimate
goal of being able to issue `helm install renku/renku` resulting
in a functioning development deployment.

* feat: Define some more sensible defaults.

* feat: Configure data-services to connect to solr (#3918)

* chore(ci): update renku actions to v1.14.1 (#3927)

Co-authored-by: Lorenzo Cavazzi <[email protected]>

* chore: update renku-ui to 3.47.0 (#3930)

* revert: Configure data services to connect to solr

Refs: e831264

* tests: add cypress tests for Renku 2.0 (#3879)

* Add prettier and update linter configuration
* Fix setting up baseUrl when running on cli
* Test project basic operations: create, edit, delete (#3881, #3908)
* Test working on groups: create, edit, delete (#3883, #3908)
* Test project resources -- code, data, environments (#3894)
* Test search entities (#3904)
* Test anonymous users navigation (#3906)
* Test running sessions (#3912)
* Update the cypress tests readme file (#3884)
* Split v2 and legacy cypress tests, improve naming (#3926)

---------

Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: Rok Roškar <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Lorenzo Cavazzi <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rok Roškar <[email protected]>
Co-authored-by: Alessandro Degano <[email protected]>
Co-authored-by: eikek <[email protected]>
Co-authored-by: Chandrasekhar Ramakrishnan <[email protected]>
Co-authored-by: Tasko Olevski <[email protected]>

This branch was successfully deployed

1 active deployment
ci-renku-3881 — ac463a60 Deployed Jan 31, 2025 by lorenzo-cavazzi
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.

3 participants