1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-28 19:06:12 +01:00
Commit Graph

26 Commits

Author SHA1 Message Date
Jaanus Sellin
c6a2303026
chore: remove featureSearchFrontend flag (#6066) 2024-01-31 09:22:26 +02:00
Fredrik Strand Oseberg
c0369b739e
refactor: isolate tests (#5433)
This PR fixes a race condition between e2e tests where bulk archiving
all toggles in the default project would delete toggles used for the
features e2e tests.

It does by isolating the features.spec and overview.spec to their
respective projects, so that they always operate on isolated data.

### Future enhancements: 

I'm not particularly fond of passing the projectName through to all the
helper methods. It complicates the tests more than it should. I would
like to be able to set the project once per test and have all the helper
methods be aware of the context. Something like this should work:

```
before(() => {
   cy.wrap('projectId').as('project');
})
```

And in the helpers: 

```
export const createFeature_API = (
    featureName: string,
    options?: Partial<Cypress.RequestOptions>,
): Chainable<any> => {
    return cy.get('@project').then((project) => {
        projectName = project || 'default';
        return cy.request({
            url: `${baseUrl}/api/admin/projects/${projectName}/features`,
            method: 'POST',
            body: {
                name: `${featureName}`,
                description: 'hello-world',
                type: 'release',
                impressionData: false,
            },
            ...options,
        });
    });
};
```
2023-11-27 13:55:44 +01:00
Nuno Góis
90296bed82
refactor: slight clean up after GAing multiple roles (#5133)
Follow up cleanup to https://github.com/Unleash/unleash/pull/5109
Based on
https://github.com/Unleash/unleash/pull/5109#pullrequestreview-1689535863
2023-10-24 09:57:01 +01:00
andreas-unleash
03faffa1d6
fix: wait for bulk archive button to become enabled (#5121)
wait for archive button to become enabled

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-23 14:46:59 +03:00
andreas-unleash
e418e9c46f
fix: make cypress list length checks more relaxed (#4933)
This PR fixes the overview.spec by relaxing the expectation on row
count.
This expectation does not seem relevant enough for some tests

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-10-05 14:50:46 +03:00
Nuno Góis
4167a60588
feat: biome lint frontend (#4903)
Follows up on https://github.com/Unleash/unleash/pull/4853 to add Biome
to the frontend as well.


![image](https://github.com/Unleash/unleash/assets/14320932/1906faf1-fc29-4172-a4d4-b2716d72cd65)

Added a few `biome-ignore` to speed up the process but we may want to
check and fix them in the future.
2023-10-02 13:25:46 +01:00
Nuno Góis
eff47d790a
test: makes overview spec less flaky by doing 2 step search (#4862)
Makes the Cypress project overview e2e spec less flaky by making the
search action a 2 step process.
This test is now passing for me locally when before it wasn't.
2023-09-29 08:18:51 +01:00
Mateusz Kwasniewski
2b85eed5b5
feat: Search UI improvements (#4613) 2023-09-06 10:50:20 +02:00
Nuno Góis
c3216ac941
fix: group roles assumption, refactor group types (#4576)
Does what it says on the tin, should help with cleaning up
https://github.com/Unleash/unleash/pull/4512 and respective schema
changes.

---------

Co-authored-by: Gastón Fournier <gaston@getunleash.io>
2023-09-05 20:30:20 +01:00
Christopher Kolstad
21b4ada577
feat: multiple project roles (#4512)
https://linear.app/unleash/issue/2-1128/change-the-api-to-support-adding-multiple-roles-to-a-usergroup-on-a

https://linear.app/unleash/issue/2-1125/be-able-to-fetch-all-roles-for-a-user-in-a-project

https://linear.app/unleash/issue/2-1127/adapt-the-ui-to-be-able-to-do-a-multi-select-on-role-permissions-for

- Allows assigning project roles to groups with root roles
- Implements new methods that support assigning, editing, removing and
retrieving multiple project roles in project access, along with other
auxiliary methods
- Adds new events for updating and removing assigned roles
- Adapts `useProjectApi` to new methods that use new endpoints that
support multiple roles
- Adds the `multipleRoles` feature flag that controls the possibility of
selecting multiple roles on the UI
- Adapts `ProjectAccessAssign` to support multiple role, using the new
methods
- Adds a new `MultipleRoleSelect` component that allows you to select
multiple roles based on the `RoleSelect` component
- Adapts the `RoleCell` component to support either a single role or
multiple roles
- Updates the `access.spec.ts` Cypress e2e test to reflect our new logic
- Updates `access-service.e2e.test.ts` with tests covering the multiple
roles logic and covering some corner cases
- Updates `project-service.e2e.test.ts` to adapt to the new logic,
adding a test that covers adding access with `[roles], [groups],
[users]`
- Misc refactors and boy scouting


![image](https://github.com/Unleash/unleash/assets/14320932/d1cc7626-9387-4ab8-9860-cd293a0d4f62)

---------

Co-authored-by: David Leek <david@getunleash.io>
Co-authored-by: Mateusz Kwasniewski <kwasniewski.mateusz@gmail.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2023-08-25 09:31:37 +01:00
Nuno Góis
22273d79e3
test: fix import and access e2e tests due to recent changes (#4467)
This should fix `import` and `access` Cypress e2e tests after recent
changes were introduced:

- `import.spec.ts` - Expected '50%' to be contained in the page, however
now [we are lazy loading the accordion
content](https://github.com/Unleash/unleash/pull/4454);
- `access.spec.ts` - Expected 'within a project are allowed' to be
visible as a role description, however [we updated the predefined roles
descriptions](https://github.com/Unleash/unleash/pull/4451);
2023-08-10 11:55:02 +00:00
Christopher Kolstad
d7b1d1c9ce
fix: Updated cypress API usage to stop using deprecated API (#3636) 2023-04-27 08:49:55 +00:00
andreas-unleash
7e5838a681
fix: remove e2e tests (#3515)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->
After discussions around e2e tests:
- Became clear that the intention is to test core functionality only

Removing 2 test files:
- notifications.spec.ts : because all PRs are run against the same
heroku backend - no guarantee that more notifications will not happen as
other tests run - so the test is flaky
- settings.spec.ts: depends on instance being enterprise and a flag on  
## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-04-13 16:04:06 +03:00
andreas-unleash
60a2c1a996
chore: Backport 4.22.3 (#3508)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->
Backports stickiness fixes 
## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Co-authored-by: Gastón Fournier <gaston@getunleash.io>
Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Mateusz Kwasniewski <kwasniewski.mateusz@gmail.com>
2023-04-12 16:22:13 +03:00
andreas-unleash
c6ba6059cc
fix: reset stickiness to default on variants modal close (#3455)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->
Expanded the onClose handler to reset stickiness to default for project
on modal close
## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-04-05 14:20:58 +03:00
Gastón Fournier
0e37e68424
feat: add PAT kill switch (#3454)
## Add the ability to disable Personal Access Tokens (PAT) admin API

This PR disables PAT admin endpoints so it's not possible to create or
get PATs the kill switch is enabled, the UI is hidden but the existing
PATs will continue to work if they were created before. The delete
endpoint still works allowing an admin to delete old PATs

By default the kill switch is disabled (i.e. PAT is enabled by default)
2023-04-05 10:20:50 +02:00
andreas-unleash
99c555bf59
chore: refactor Cypress tests (#3445)
Adds proper typescript support.
Created reusable commands
Added README for cypress test
Refactored tests
Fixed bugs as I found them.
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-04-04 11:46:28 +03:00
Tymoteusz Czech
f124997485
E2E test - batch updates (#3392) 2023-03-29 14:47:12 +03:00
Tymoteusz Czech
00d2087737
fix: update notifications e2e specs 2023-03-28 14:26:51 +02:00
Tymoteusz Czech
583eb63e75
fix e2e notifications specs setup 2023-03-28 14:26:08 +02:00
andreas-unleash
32e1ad44ed
Feat/add cypress tests for project scoped stickiness (#3340)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->


## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-03-17 14:41:59 +02:00
andreas-unleash
068c55a925
Feat/notifications cypress (#3244)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #
[1-743](https://linear.app/unleash/issue/1-743/add-cypress-test-for-notifications-happy-path)

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-03-08 12:47:42 +02:00
sjaanus
fb06fa9f46
Remove full width access tab (#2679)
Remove full width access tab
2022-12-13 13:41:40 +02:00
Fredrik Strand Oseberg
928b3515dc
fix: update package json and remove empty exports (#2625)
* Removes exports statements in e2e tests
* Updates package.json to optionally use heroku url for e2e tests when
running locally
2022-12-07 14:08:59 +01:00
sjaanus
e21cf00ca7
Merge e2e tests into matrix (#2007) 2022-08-30 13:23:09 +00:00
sjaanus
5ffb63e342 Add cypress tests for project access page (#1215)
* Add tests

* Some fixes

* Fix test
2022-08-12 09:54:32 +00:00