Skip to content

Commit 90150a5

Browse files
committed
eslint
1 parent 5a4d798 commit 90150a5

23 files changed

+132
-102
lines changed

e2e-playwright/.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cucumber.js
2+
init.ts
3+
playwright.config.ts
4+
env.d.ts

e2e-playwright/config/cucumber.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
module.exports = {
23
default: {
34
timeout: 30000,

e2e-playwright/eslint.config.js

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
1+
import { defineConfig } from "eslint/config";
12
import js from "@eslint/js";
23
import globals from "globals";
34
import tseslint from "typescript-eslint";
4-
import { defineConfig } from "eslint/config";
5-
65

76
export default defineConfig([
8-
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"] },
9-
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser } },
10-
{ files: ["**/*.{ts,tsx}"], ...tseslint.configs.recommendedTypeChecked, languageOptions: { parserOptions: {project: "./tsconfig.json" } } },
11-
tseslint.configs.recommended,
12-
]);
7+
js.configs.recommended,
8+
{
9+
files: ["**/*.{ts,tsx}"],
10+
languageOptions: {
11+
parser: tseslint.parser,
12+
parserOptions: {
13+
project: "./tsconfig.json",
14+
},
15+
globals: {
16+
...globals.node,
17+
...globals.browser,
18+
},
19+
},
20+
plugins: {
21+
"@typescript-eslint": tseslint.plugin,
22+
},
23+
rules: {
24+
"no-trailing-spaces": "error",
25+
"no-multiple-empty-lines": ["error", { max: 1 }],
26+
"semi-spacing": ["error", { before: false, after: true }],
27+
"keyword-spacing": ["error", { before: true, after: true }],
28+
"space-infix-ops": "error",
29+
"space-before-blocks": "error",
30+
"space-before-function-paren": ["error", "never"],
31+
"object-curly-spacing": ["error", "always"],
32+
"array-bracket-spacing": ["error", "never"],
33+
'no-invalid-this': 'off',
34+
},
35+
},
36+
]);

e2e-playwright/src/helper/types/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
export { };
23

34
declare global {

e2e-playwright/src/helper/wrapper/assert.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Page } from "@playwright/test";
22
import expect from "../util/expect";
33

44
export default class Assert {
5-
5+
// eslint-disable-next-line no-unused-vars
66
constructor(private page: Page) { }
77

88
async assertTitle(title: string) {
@@ -22,5 +22,4 @@ export default class Assert {
2222
const pageURL = this.page.url();
2323
expect(pageURL).toContain(title);
2424
}
25-
2625
}

e2e-playwright/src/hooks/hooks.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import { PlaywrightCustomWorld } from '../support/PlaywrightCustomWorld';
77

88
let browser: Browser;
99

10-
BeforeAll(async function () {
10+
BeforeAll(async function() {
1111
browser = await invokeBrowser();
1212
});
1313

1414
setDefaultTimeout(60 * 1000);
1515

1616
setWorldConstructor(PlaywrightCustomWorld);
1717

18-
Before(async function (this: PlaywrightCustomWorld, { pickle }) {
18+
Before(async function(this: PlaywrightCustomWorld, { pickle }) {
1919
const scenarioName = pickle.name + pickle.id
2020
const context = await browser.newContext({
2121
recordVideo: { dir: 'test-results/videos/' },
@@ -30,8 +30,8 @@ Before(async function (this: PlaywrightCustomWorld, { pickle }) {
3030
await this.init(context, scenarioName);
3131
});
3232

33-
After({ timeout: 30000 }, async function (this: PlaywrightCustomWorld, { pickle, result }) {
34-
let img: Buffer | undefined;
33+
After({ timeout: 30000 }, async function(this: PlaywrightCustomWorld, { pickle, result }) {
34+
let img: Buffer | undefined;
3535
const path = `./test-results/trace/${pickle.id}.zip`;
3636
try {
3737
if (result?.status === Status.FAILED) {
@@ -80,6 +80,6 @@ After({ timeout: 30000 }, async function (this: PlaywrightCustomWorld, { pickle,
8080
}
8181
});
8282

83-
AfterAll(async function () {
83+
AfterAll(async function() {
8484
await browser.close();
8585
})

e2e-playwright/src/pages/BaseLocators.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Locator, Page } from '@playwright/test';
22

33
export class BaseLocators {
4+
// eslint-disable-next-line no-unused-vars
45
constructor(private page: Page) {}
56

67
loadingSpinner:Locator = this.page.locator('div[role="progressbar"]');

e2e-playwright/src/pages/Brokers/BrokersLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class BrokersLocators{
3+
export default class BrokersLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class ConnectorsLocators{
3+
export default class ConnectorsLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/Consumers/ConsumersLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class ConsumersLocators{
3+
export default class ConsumersLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/Dashboard/DashboardLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class DashboardLocators{
3+
export default class DashboardLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/KSQLDB/ksqldbLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class ksqlDbLocators{
3+
export default class ksqlDbLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/Panel/PanelLocators.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class PanelLocators{
3+
export default class PanelLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {
77
this.page = page;
88
}
99

10-
linkByName(name: string): Locator{
10+
linkByName(name: string): Locator {
1111
return this.page.getByRole('link', { name });
1212
}
13-
13+
1414
brokersLink(): Locator { return this.linkByName('Brokers');}
1515
topicsLink(): Locator { return this.page.getByTitle('Topics');}
1616
consumersLink(): Locator { return this.linkByName('Consumers');}

e2e-playwright/src/pages/SchemaRegistry/SchemaRegistryLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class SchemaRegistryLocators{
3+
export default class SchemaRegistryLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/Topics/TopicsCreateLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class TopicCreateLocators{
3+
export default class TopicCreateLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {

e2e-playwright/src/pages/Topics/TopicsLocators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Page, Locator } from "@playwright/test";
22

3-
export default class TopicsLocators{
3+
export default class TopicsLocators {
44
private readonly page: Page;
55

66
constructor(page: Page) {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
12
import { defineConfig } from '@playwright/test';
23

34
export default defineConfig({
45
timeout: 30_000,
56
});
7+

e2e-playwright/src/services/uiHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Locator } from '@playwright/test';
22
import expect from "../helper/util/expect";
33

4-
export const expectVisibility = async (locator: Locator, visibleString: string): Promise<void> => {
4+
export const expectVisibility = async(locator: Locator, visibleString: string): Promise<void> => {
55
if (visibleString === "true") {
66
await expect(locator).toBeVisible();
77
} else {
88
await expect(locator).toHaveCount(0);
99
}
1010
};
1111

12-
export const ensureCheckboxState = async (checkbox: Locator, expectedState: string) => {
12+
export const ensureCheckboxState = async(checkbox: Locator, expectedState: string) => {
1313
const desiredState = expectedState === 'true';
1414
const isChecked = await checkbox.isChecked();
1515

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
import { Given, When, Then, setDefaultTimeout } from "@cucumber/cucumber";
22
import { expect } from "@playwright/test";
33
import { expectVisibility, ensureCheckboxState } from "../services/uiHelper";
4-
import { PlaywrightCustomWorld } from "../support/PlaywrightCustomWorld";
4+
import { PlaywrightCustomWorld } from "../support/PlaywrightCustomWorld";
55

66
setDefaultTimeout(60 * 1000 * 2);
77

8-
Given('Topics Serchfield visible', async function (this: PlaywrightCustomWorld) {
8+
Given('Topics Serchfield visible', async function() {
99
await expect(this.locators.topics.topicSearchField()).toBeVisible();
1010
});
1111

12-
Given('Topics ShowInternalTopics visible', async function (this: PlaywrightCustomWorld) {
12+
Given('Topics ShowInternalTopics visible', async function() {
1313
await expect(this.locators.topics.topicShowInternalTopics()).toBeVisible();
1414
});
1515

16-
Given('Topics AddATopic visible', async function (this: PlaywrightCustomWorld) {
16+
Given('Topics AddATopic visible', async function() {
1717
await expect(this.locators.topics.topicAddTopicButton()).toBeVisible();
1818
});
1919

20-
Given('Topics DeleteSelectedTopics active is: {string}', async function (this: PlaywrightCustomWorld, state: string) {
20+
Given('Topics DeleteSelectedTopics active is: {string}', async function(this: PlaywrightCustomWorld, state: string) {
2121
const isEnabled = await this.locators.topics.topicDeleteSelectedTopicsButton().isEnabled();
2222
expect(isEnabled.toString()).toBe(state);
2323
});
2424

25-
Given('Topics CopySelectedTopic active is: {string}', async function (this: PlaywrightCustomWorld, state: string) {
25+
Given('Topics CopySelectedTopic active is: {string}', async function(this: PlaywrightCustomWorld, state: string) {
2626
const isEnabled = await this.locators.topics.topicCopySelectedTopicButton().isEnabled();
2727
expect(isEnabled.toString()).toBe(state);
2828
});
2929

30-
Given('Topics PurgeMessagesOfSelectedTopics active is: {string}', async function (this: PlaywrightCustomWorld, state: string) {
30+
Given('Topics PurgeMessagesOfSelectedTopics active is: {string}', async function(this: PlaywrightCustomWorld, state: string) {
3131
const isEnabled = await this.locators.topics.topicPurgeMessagesOfSelectedTopicsButton().isEnabled();
3232
expect(isEnabled.toString()).toBe(state);
3333
});
3434

35-
When('Topic SelectAllTopic visible is: {string}', async function (this: PlaywrightCustomWorld, visible: string) {
35+
When('Topic SelectAllTopic visible is: {string}', async function(this: PlaywrightCustomWorld, visible: string) {
3636
await expectVisibility(this.locators.topics.topicSelectAllCheckBox(), visible);
3737
});
3838

39-
Then('Topic SelectAllTopic checked is: {string}', async function (this: PlaywrightCustomWorld, state: string) {
39+
Then('Topic SelectAllTopic checked is: {string}', async function(this: PlaywrightCustomWorld, state: string) {
4040
const checkbox = this.locators.topics.topicSelectAllCheckBox();
4141
await ensureCheckboxState(checkbox, state);
4242
const actual = await checkbox.isChecked();
4343
expect(actual.toString()).toBe(state);
4444
});
4545

46-
When('Topics serchfield input {string}', async function (this: PlaywrightCustomWorld, topicName: string) {
46+
When('Topics serchfield input {string}', async function(this: PlaywrightCustomWorld, topicName: string) {
4747
const textBox = this.locators.topics.topicSearchField();
4848
await textBox.fill(topicName);
4949
const actual = await textBox.inputValue();
5050
expect(actual).toBe(topicName);
5151
});
5252

53-
Then('Topic named: {string} visible is: {string}', async function (this: PlaywrightCustomWorld, topicName: string, visible: string) {
53+
Then('Topic named: {string} visible is: {string}', async function(this: PlaywrightCustomWorld, topicName: string, visible: string) {
5454
await expectVisibility(this.locators.topics.topicNameLink(topicName), visible);
5555
});
5656

57-
When('Topic serchfield input cleared', async function (this: PlaywrightCustomWorld) {
57+
When('Topic serchfield input cleared', async function() {
5858
const textBox = this.locators.topics.topicSearchField();
5959
await textBox.fill('');
6060
const text = await textBox.inputValue();
6161
expect(text).toBe('');
6262
});
6363

64-
When('Topics ShowInternalTopics switched is: {string}', async function (this: PlaywrightCustomWorld, state: string) {
64+
When('Topics ShowInternalTopics switched is: {string}', async function(this: PlaywrightCustomWorld, state: string) {
6565
const checkBox = this.locators.topics.topicShowInternalTopics();
6666
await ensureCheckboxState(checkBox, state);
6767
});
6868

69-
When('Topic row named: {string} checked is: {string}', async function (this: PlaywrightCustomWorld, topicName: string, state: string) {
69+
When('Topic row named: {string} checked is: {string}', async function(this: PlaywrightCustomWorld, topicName: string, state: string) {
7070
const checkbox = this.locators.topics.topicRowCheckBox(topicName);
7171
await ensureCheckboxState(checkbox, state);
7272
});

0 commit comments

Comments
 (0)