@@ -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