Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@eslint/js": "^9.11.1",
"@hmcts/playwright-common": "^1.0.30",
"@hmcts/playwright-common": "^1.0.33",
"@playwright/test": "^1.48.2",
"@types/node": "^22.15.34",
"@typescript-eslint/eslint-plugin": "^8.8.0",
Expand Down
43 changes: 43 additions & 0 deletions playwright-e2e/tests/user-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { test } from "../fixtures";

test.describe("User tests using idam utils", () => {
test("Update user", async ({
page,
config,
citizenUserUtils,
idamPage,
idamUtils,
}) => {
//create citizen user
const token = process.env.CREATE_USER_BEARER_TOKEN as string;
const user = await citizenUserUtils.createUser();
await page.goto(config.urls.citizenUrl);

//login citizen user
await idamPage.login({
username: user.email,
password: user.password,
});

//get user id for citizen user
const userInfo = await idamUtils.getUserInfo({
email: user.email,
bearerToken: token,
});
console.log(userInfo);

//update user with new forename and surname
const userUpdate = await idamUtils.updateUser({
id: userInfo.id,
bearerToken: token,
password: user.password,
user: {
email: user.email,
forename: "changed forename",
surname: "changed surname",
roleNames: ["citizen"],
},
});
console.log(userUpdate);
});
});
36 changes: 7 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,24 @@ __metadata:
languageName: node
linkType: hard

"@hmcts/playwright-common@npm:^1.0.30":
version: 1.0.32
resolution: "@hmcts/playwright-common@npm:1.0.32"
"@hmcts/playwright-common@npm:^1.0.33":
version: 1.0.33
resolution: "@hmcts/playwright-common@npm:1.0.33"
dependencies:
"@axe-core/playwright": "npm:^4.10.0"
"@eslint/js": "npm:^9.11.1"
"@typescript-eslint/eslint-plugin": "npm:^8.8.0"
eslint: "npm:^9.11.1"
eslint-plugin-playwright: "npm:^1.6.2"
eslint-plugin-playwright: "npm:^2.0.0"
get-port: "npm:^7.1.0"
globals: "npm:^15.10.0"
globals: "npm:^16.0.0"
lighthouse: "npm:^12.2.1"
playwright-lighthouse: "npm:^4.0.0"
typescript: "npm:^5.6.2"
typescript-eslint: "npm:^8.8.0"
peerDependencies:
"@playwright/test": ^1.53.0
checksum: 10/cec3a079d220c2402e9621693d3b0581b3e6bac8e33304c93d418ae8de73f05f18611413d9d26697a5c5a55d31610d75381388e79ed2eabd7bc6d21764163496
checksum: 10/bcdde79e4dfd16635614493c234ed49fc6ecd7d8c0d33d649c8b368e262d37a986fbfcaf9ea99d30b00899304986ede7626ab02626dc5b8ea6e5fd4b53953052
languageName: node
linkType: hard

Expand Down Expand Up @@ -1633,21 +1633,6 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-playwright@npm:^1.6.2":
version: 1.8.3
resolution: "eslint-plugin-playwright@npm:1.8.3"
dependencies:
globals: "npm:^13.23.0"
peerDependencies:
eslint: ">=8.40.0"
eslint-plugin-jest: ">=25"
peerDependenciesMeta:
eslint-plugin-jest:
optional: true
checksum: 10/8a0b9f51ba1eb09e64e15452cc78ab7fc82a68e45a432185acc2851eb0ad67b683e9bb2ca9ac9791267608ca0ceb0fca2b551868d494831e1ed62b2c566c099e
languageName: node
linkType: hard

"eslint-plugin-playwright@npm:^2.0.0":
version: 2.2.1
resolution: "eslint-plugin-playwright@npm:2.2.1"
Expand Down Expand Up @@ -2062,13 +2047,6 @@ __metadata:
languageName: node
linkType: hard

"globals@npm:^15.10.0":
version: 15.15.0
resolution: "globals@npm:15.15.0"
checksum: 10/7f561c87b2fd381b27fc2db7df8a4ea7a9bb378667b8a7193e61fd2ca3a876479174e2a303a74345fbea6e1242e16db48915c1fd3bf35adcf4060a795b425e18
languageName: node
linkType: hard

"globals@npm:^16.0.0":
version: 16.3.0
resolution: "globals@npm:16.3.0"
Expand Down Expand Up @@ -3397,7 +3375,7 @@ __metadata:
dependencies:
"@axe-core/playwright": "npm:^4.10.0"
"@eslint/js": "npm:^9.11.1"
"@hmcts/playwright-common": "npm:^1.0.30"
"@hmcts/playwright-common": "npm:^1.0.33"
"@playwright/test": "npm:^1.48.2"
"@types/node": "npm:^22.15.34"
"@typescript-eslint/eslint-plugin": "npm:^8.8.0"
Expand Down