diff --git a/tests/wdio/.eslintrc.json b/tests/wdio/.eslintrc.json index 68900693d..d4095a2a3 100644 --- a/tests/wdio/.eslintrc.json +++ b/tests/wdio/.eslintrc.json @@ -15,6 +15,15 @@ "linebreak-style": ["error", "unix"], "quotes": ["error", "double", { "avoidEscape": true }], "semi": ["error", "always"], - "@typescript-eslint/ban-ts-comment": "off" + "@typescript-eslint/ban-ts-comment": "off", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } + ] } } diff --git a/tests/wdio/test/specs/new-application-by-wizard.ts b/tests/wdio/test/specs/new-application-by-wizard.ts index ad3aad4d9..6e4965779 100644 --- a/tests/wdio/test/specs/new-application-by-wizard.ts +++ b/tests/wdio/test/specs/new-application-by-wizard.ts @@ -31,6 +31,9 @@ async function getCommitMessage() { return await ApplicationWizardView.successMessage; } +const SUCCESS_MESSAGE = "Your application has been saved"; +const EXPLICIT_CONSENT = "default-provider-authorization-explicit-consent"; + describe("Configure Applications with the Application Wizard", () => { it("Should configure a simple LDAP Application", async () => { await reachTheProvider("New LDAP Application"); @@ -46,7 +49,7 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); it("Should configure a simple Oauth2 Application", async () => { @@ -59,13 +62,11 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await ApplicationWizardView.oauth.setAuthorizationFlow( - "default-provider-authorization-explicit-consent", - ); + await ApplicationWizardView.oauth.setAuthorizationFlow(EXPLICIT_CONSENT); await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); it("Should configure a simple SAML Application", async () => { @@ -78,14 +79,12 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await ApplicationWizardView.saml.setAuthorizationFlow( - "default-provider-authorization-explicit-consent", - ); + await ApplicationWizardView.saml.setAuthorizationFlow(EXPLICIT_CONSENT); await ApplicationWizardView.saml.acsUrl.setValue("http://example.com:8000/"); await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); it("Should configure a simple SCIM Application", async () => { @@ -103,7 +102,7 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); it("Should configure a simple Radius Application", async () => { @@ -120,7 +119,7 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); it("Should configure a simple Transparent Proxy Application", async () => { @@ -132,9 +131,7 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await ApplicationWizardView.transparentProxy.setAuthorizationFlow( - "default-provider-authorization-explicit-consent", - ); + await ApplicationWizardView.transparentProxy.setAuthorizationFlow(EXPLICIT_CONSENT); await ApplicationWizardView.transparentProxy.externalHost.setValue( "http://external.example.com", ); @@ -145,7 +142,7 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); it("Should configure a simple Forward Proxy Application", async () => { @@ -157,9 +154,7 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await ApplicationWizardView.forwardProxy.setAuthorizationFlow( - "default-provider-authorization-explicit-consent", - ); + await ApplicationWizardView.forwardProxy.setAuthorizationFlow(EXPLICIT_CONSENT); await ApplicationWizardView.forwardProxy.externalHost.setValue( "http://external.example.com", ); @@ -167,6 +162,6 @@ describe("Configure Applications with the Application Wizard", () => { await ApplicationWizardView.nextButton.click(); await ApplicationWizardView.pause(); - await expect(getCommitMessage()).toHaveText("Your application has been saved"); + await expect(getCommitMessage()).toHaveText(SUCCESS_MESSAGE); }); }); diff --git a/tests/wdio/wdio.conf.ts b/tests/wdio/wdio.conf.ts index 6ece78e1d..525cfb00d 100644 --- a/tests/wdio/wdio.conf.ts +++ b/tests/wdio/wdio.conf.ts @@ -209,7 +209,7 @@ export const config: Options.Testrunner = { * @param {Array.} specs List of spec file paths that are to be run * @param {object} browser instance of created browser/device session */ - before: function (capabilities, specs) {}, + before: function (_capabilities, _specs) {}, /** * Runs before a WebdriverIO command gets executed. * @param {string} commandName hook command name