Skip to content

Commit e994606

Browse files
committed
add test for UpgradeProtection license
1 parent dff59e8 commit e994606

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

src/Frontend/test/preconditions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from "../preconditions/hasLicense";
1+
export * from "../preconditions/licensing";
22
export { hasServiceControlMainInstance } from "../preconditions/hasServiceControlMainInstance";
33
export { hasServiceControlMonitoringInstance } from "../preconditions/hasServiceControlMonitoringInstance";
44
export { hasServiceControlMonitoringInstanceUrl } from "../preconditions/hasServiceControlMonitoringInstanceUrl";

src/Frontend/test/specs/configuration/viewing-license.spec.ts

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,35 @@ describe("FEATURE: License", () => {
7272
});
7373
});
7474

75-
// describe("RULE: Remaining license period should be displayed", () => {
76-
// test("EXAMPLE: License expiring in more than 10 days should show 'X days left", async ({ driver }) => {
77-
// /* SCENARIO
78-
// License expiring in the future
79-
80-
// Given a platform license which expires more than 10 days from now
81-
// Then "X days left" is shown
82-
// */
83-
// await driver.setUp(precondition.serviceControlWithMonitoring);
84-
// await driver.setUp(precondition.hasActiveLicense);
85-
// await driver.goTo("/configuration/license");
86-
// waitFor(async () => {
87-
// expect(await licenseExpiryDaysLeft()).toContain("days left");
88-
// });
89-
// });
90-
// });
75+
describe("RULE: Upgrade Protection license expiring soon must be displayed", () => {
76+
test("EXAMPLE: Upgrade Protection license expiring with x days should show 'X days left'", async ({ driver }) => {
77+
await driver.setUp(precondition.serviceControlWithMonitoring);
78+
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, 10));
79+
await driver.goTo("/configuration/license");
80+
await waitFor(async () => {
81+
// expect(await licenseExpiryDaysLeft()).toBeVisible(); //License expiry date: 2/5/2025 - expiring in 11 days
82+
expect(await licenseExpiryDaysLeft()).toContain("days left"); //License expiry date: 2/5/2025 - expiring in 11 days
83+
});
84+
});
85+
test("EXAMPLE: Upgrade Protection license expiring tomorrow should show 'expiring tomorrow'", async ({ driver }) => {
86+
await driver.setUp(precondition.serviceControlWithMonitoring);
87+
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, 0));
88+
await driver.goTo("/configuration/license");
89+
await waitFor(async () => {
90+
// expect(await licenseExpiryDaysLeft()).toBeVisible();
91+
expect(await licenseExpiryDaysLeft()).toContain("1 day left");
92+
});
93+
});
94+
test("EXAMPLE: Upgrade Protection license expiring today should show 'expired'", async ({ driver }) => {
95+
await driver.setUp(precondition.serviceControlWithMonitoring);
96+
await driver.setUp(precondition.hasExpiringLicense(LicenseType.UpgradeProtection, -1));
97+
await driver.goTo("/configuration/license");
98+
await waitFor(async () => {
99+
//expect(await licenseExpiryDaysLeft()).toBeVisible();
100+
expect(await licenseExpiryDaysLeft()).toContain("expired");
101+
});
102+
});
103+
});
91104
describe("RULE: Non-license options should be hidden if license has expired", () => {
92105
test.todo("EXAMPLE: Only 'LICENSE' tab is visible when license has expired");
93106

0 commit comments

Comments
 (0)