@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 +3 -3
- package/fixtures/test/app/index.d.ts +1 -1
- package/fixtures/test/app/index.js +10 -6
- package/package.json +4 -4
- package/playwright.config.js +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#  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
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.38.0)
|
|
6
6
|
[](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.
|
|
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({
|
|
54
|
+
async changeAppMemberRole({ request }, use) {
|
|
55
55
|
await use(async (appId, role) => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
await
|
|
60
|
-
|
|
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.
|
|
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.
|
|
45
|
-
"@appsemble/node-utils": "0.
|
|
46
|
-
"@appsemble/types": "0.
|
|
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
|
},
|
package/playwright.config.js
CHANGED
|
@@ -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/ },
|