@appsemble/e2e 0.37.5 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.37.5/config/assets/logo.svg) Appsemble End 2 End Tests
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.38.0/config/assets/logo.svg) Appsemble End 2 End Tests
2
2
 
3
3
  > Run end 2 end tests on an Appsemble environment and provide Appsemble fixtures
4
4
 
5
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.37.5/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.37.5)
5
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.38.0/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.38.0)
6
6
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
7
7
 
8
8
  ## Table of Contents
@@ -102,5 +102,5 @@ When writing end-to-end tests, have a look at the
102
102
 
103
103
  ## License
104
104
 
105
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.37.5/LICENSE.md) ©
105
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.38.0/LICENSE.md) ©
106
106
  [Appsemble](https://appsemble.com)
@@ -24,7 +24,7 @@ export interface AppFixtures {
24
24
  /**
25
25
  * Set the role of the user.
26
26
  *
27
- * Note that this requires the user to be logged in to the studio.
27
+ * Note that this requires the user to be logged in to the studio and added to the app.
28
28
  *
29
29
  * @param appId The ID of the app to set the role for.
30
30
  * @param role The role to set.
@@ -51,13 +51,17 @@ export const test = base.extend({
51
51
  expect(response.status()).toBe(204);
52
52
  });
53
53
  },
54
- async changeAppMemberRole({ browser }, use) {
54
+ async changeAppMemberRole({ request }, use) {
55
55
  await use(async (appId, role) => {
56
- const page = await browser.newPage();
57
- await page.goto(`/en/apps/${appId}/-/members`);
58
- const select = page.locator('tr', { hasText: 'It’s you!' }).locator('select[class=""]');
59
- await select.selectOption(role);
60
- await page.close();
56
+ const currentUser = (await (await request.get('/api/users/current')).json());
57
+ const filter = encodeURIComponent(`email eq '${currentUser.email.replaceAll("'", "''")}'`);
58
+ const currentAppMember = (await (await request.get(`/api/apps/${appId}/members?$filter=${filter}`)).json())[0];
59
+ const response = await request.put(`/api/apps/${appId}/app-members/${currentAppMember.sub}/role`, {
60
+ data: {
61
+ roles: [role],
62
+ },
63
+ });
64
+ await expect(response).toBeOK();
61
65
  });
62
66
  },
63
67
  async getAppId({ request }, use) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/e2e",
3
- "version": "0.37.5",
3
+ "version": "0.38.0",
4
4
  "description": "End-to-end tests used for testing Appsemble apps in an existing environment.",
5
5
  "keywords": [
6
6
  "app",
@@ -41,9 +41,9 @@
41
41
  "@playwright/test": "Pinned exact and kept in sync with the mcr.microsoft.com/playwright:v<version>-noble tag of the `e2e node` job in .gitlab-ci.yml; Renovate bumps both together (see renovate.json)."
42
42
  },
43
43
  "dependencies": {
44
- "@appsemble/lang-sdk": "0.37.5",
45
- "@appsemble/node-utils": "0.37.5",
46
- "@appsemble/types": "0.37.5",
44
+ "@appsemble/lang-sdk": "0.38.0",
45
+ "@appsemble/node-utils": "0.38.0",
46
+ "@appsemble/types": "0.38.0",
47
47
  "@playwright/test": "1.62.1",
48
48
  "strip-indent": "^4.0.0"
49
49
  },
@@ -75,7 +75,7 @@ export default defineConfig({
75
75
  {
76
76
  name: 'webkit',
77
77
  testIgnore: '**/static-ui/**',
78
- use: { ...devices['Desktop Safari'] },
78
+ use: { ...devices['Desktop Safari'], serviceWorkers: 'block' },
79
79
  dependencies: ['create-accounts'],
80
80
  },
81
81
  { name: 'teardown-accounts', testMatch: /teardown-accounts\.setup\.ts/ },