Skip to content

Commit 12d0861

Browse files
CircleCI tests 2nd try
1 parent 32c9378 commit 12d0861

16 files changed

Lines changed: 3596 additions & 3167 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ aliases:
2222
then
2323
echo "skipping npm install as it was restored from cache. Running only postinstall"
2424
else
25-
yarn install --frozen-lockfile
25+
yarn install --frozen-lockfile --ignore-scripts
2626
fi
2727
2828
commands:
@@ -54,7 +54,7 @@ executors:
5454

5555
playwright:
5656
docker:
57-
- image: mcr.microsoft.com/playwright:v1.52.0-noble
57+
- image: mcr.microsoft.com/playwright:v1.58.1-noble
5858
working_directory: ~/nova
5959
environment:
6060
NODE_ENV: development

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
"zone.js": "0.15.0"
8585
},
8686
"resolutions": {
87-
"d3-color": "3.1.0"
87+
"d3-color": "3.1.0",
88+
"tablesort": "5.3.0"
8889
},
8990
"engines": {
9091
"node": ">=20"

packages/bits/e2e/components/datepicker/datepicker.e2e.spec.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410,22 +410,20 @@ test.describe("USERCONTROL datepicker", () => {
410410
test("should save hour correctly when triggered at 23:00 - 0:00", async () => {
411411
await datepickerWithInitAndPreserve.clickInput();
412412
await datepickerWithInitAndPreserve.selectDate(5);
413-
const oldValue = await Atom.find<Atom>(
414-
Atom,
415-
initDateValueIdPreserved
416-
)
417-
.getLocator()
418-
.textContent();
413+
const oldValue = (
414+
await Atom.find<Atom>(Atom, initDateValueIdPreserved)
415+
.getLocator()
416+
.textContent()
417+
)?.trim();
419418
await datepickerWithInitAndPreserve.clickInput();
420419
await datepickerWithInitAndPreserve.selectDate(
421420
moment().date() > 15 ? 10 : 20
422421
);
423-
const newValue = await Atom.find<Atom>(
424-
Atom,
425-
initDateValueIdPreserved
426-
)
427-
.getLocator()
428-
.textContent();
422+
const newValue = (
423+
await Atom.find<Atom>(Atom, initDateValueIdPreserved)
424+
.getLocator()
425+
.textContent()
426+
)?.trim();
429427

430428
expect(newValue).not.toBe(oldValue);
431429
expect(moment(newValue).hour()).toBe(moment(oldValue).hour());

packages/bits/e2e/components/menu/menu.e2e.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ test.describe("USERCONTROL Menu", () => {
130130
expect(await menu.getSelectedSwitchesCount()).toEqual(1);
131131

132132
await Helpers.pressKey("Enter");
133+
await menu.isMenuOpened();
133134
expect(await menu.getSelectedSwitchesCount()).toEqual(0);
134135

135136
await Helpers.pressKey("Enter");
137+
await menu.isMenuOpened();
136138
await Helpers.pressKey("ArrowDown");
137139
await Helpers.pressKey("Enter");
138140
expect(await menu.getSelectedSwitchesCount()).toEqual(2);
@@ -186,16 +188,18 @@ test.describe("USERCONTROL Menu", () => {
186188
test.describe("> append-to-body", () => {
187189
test("should check and uncheck checkbox in menu item", async () => {
188190
await appendToBody.toggleMenu();
189-
// Find the first checkbox in the appendToBody menu
191+
// Find all checkboxes in the appendToBody menu
190192
const menuLocator = appendToBody.getAppendToBodyMenu();
191-
await expect(menuLocator).toBeVisible();
192-
await Helpers.pressKey("ArrowDown");
193193
const checkboxes = menuLocator.locator("nui-checkbox");
194194
const firstCheckbox = checkboxes.first();
195+
195196
// Check class for checked state
196197
await expect(firstCheckbox).not.toHaveClass(/nui-checkbox--checked/);
198+
199+
await Helpers.pressKey("ArrowDown");
197200
await Helpers.pressKey("Enter");
198201
await expect(firstCheckbox).toHaveClass(/nui-checkbox--checked/);
202+
199203
// Return to initial state
200204
await Helpers.pressKey("Enter");
201205
await expect(firstCheckbox).not.toHaveClass(/nui-checkbox--checked/);

packages/bits/e2e/components/paginator/paginator.atom.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ export class PaginatorAtom extends Atom {
6969
}
7070

7171
public async pageLinkVisible(pageNumber: number): Promise<boolean> {
72-
const li = this.getLocator().locator(
73-
`.nui-paginator__list li[value='${pageNumber}']:not([title*='Previous']):not([title*='Next']):not([title*='Pages'])`
74-
);
75-
return (await li.count()) > 0 && (await li.first().isVisible());
72+
return this.getPageLinkLocator(pageNumber).isVisible();
73+
}
74+
75+
public getPageLinkLocator(pageNumber: number): Locator {
76+
return this.getLocator()
77+
.locator(
78+
`.nui-paginator__list li[value='${pageNumber}']:not([title*='Previous']):not([title*='Next']):not([title*='Pages'])`
79+
)
80+
.first();
7681
}
7782

7883
public async ellipsedPageLinkClick(pageNumber: number): Promise<void> {

packages/bits/e2e/components/paginator/paginator.e2e.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ test.describe("USERCONTROL paginator", () => {
170170
expect(
171171
await adjacentPaginator.pageLinkVisible(pageTwenty + adjacent)
172172
).toBe(true);
173-
expect(
174-
await adjacentPaginator.pageLinkVisible(pageCountAdjacent)
175-
).toBe(true);
173+
await expect(
174+
adjacentPaginator.getPageLinkLocator(pageCountAdjacent)
175+
).toBeVisible();
176176
for (
177177
let i = pageTwenty + adjacent + 1;
178178
i < pageCountAdjacent;

packages/bits/e2e/components/spinner/spinner.atom.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export class SpinnerAtom extends Atom {
3636
}
3737

3838
public async waitForDisplayed(
39-
timeout: number = SpinnerAtom.defaultDelay * 1.5
39+
timeout: number = SpinnerAtom.defaultDelay * 5
4040
): Promise<void> {
4141
await expect(this.root).toBeVisible({ timeout });
4242
}
4343

4444
public async waitForHidden(
45-
timeout: number = SpinnerAtom.defaultDelay * 1.5
45+
timeout: number = SpinnerAtom.defaultDelay * 5
4646
): Promise<void> {
4747
await expect(this.root).toBeHidden({ timeout });
4848
}

packages/bits/e2e/components/spinner/spinner.e2e.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ test.describe("USERCONTROL Spinner", () => {
4747
test("with delayed set", async () => {
4848
await delayedSpinner.toBeHidden();
4949
await delayedButton.click();
50-
await delayedSpinner.waitForDisplayed(spinnerDelay * 2);
50+
await delayedSpinner.waitForDisplayed(spinnerDelay * 5);
5151
await delayedButton.click();
5252
await delayedSpinner.toBeHidden();
5353
});
5454

5555
test("without delay", async () => {
5656
await spinner2.toBeHidden();
5757
await button2.click();
58-
await spinner2.waitForDisplayed(SpinnerAtom.defaultDelay * 2);
58+
await spinner2.waitForDisplayed(SpinnerAtom.defaultDelay * 5);
5959
await button2.click();
6060
await spinner2.toBeHidden();
6161
});
6262
});
6363

6464
test("should have 'small' default size if no 'size' input provided", async () => {
6565
await button2.click();
66-
await spinner2.waitForDisplayed(SpinnerAtom.defaultDelay * 2);
66+
await spinner2.waitForDisplayed(SpinnerAtom.defaultDelay * 5);
6767
await expect(spinner2.getLocator()).toHaveClass(
6868
/nui-spinner__container--small/
6969
);

packages/bits/e2e/components/textbox-number/textbox-number.e2e.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ test.describe("USERCONTROL textbox-number >", () => {
201201
each(["-", "+", "1e", "eee", "1-1", "1+1"], (invalidValue) => {
202202
test(`should reject incorrect string input: '${invalidValue}'`, async () => {
203203
await component.acceptText(invalidValue);
204+
await component.input.blur();
204205
expect(await component.isValid()).toBe(false);
205206
});
206207
});

packages/bits/spec/components/combobox/combobox.e2e.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ describe("USERCONTROL Combobox >", () => {
5252
let comboboxAppendToBody: ComboboxAtom;
5353
let comboboxRemoveValueButton: ComboboxAtom;
5454

55+
const applySafeType = async (atom: ComboboxAtom, text: string): Promise<void> => {
56+
await atom.acceptInput(text);
57+
if ((await atom.getInputValue()) !== text) {
58+
await atom.clearText();
59+
for (const char of text) { // Type character by character to prevent lost spaces
60+
await atom.getInput().sendKeys(char);
61+
await browser.sleep(20); // Small delay to ensure stability in CI
62+
}
63+
}
64+
};
65+
5566
beforeAll(() => {
5667
comboboxBasic = Atom.find(ComboboxAtom, "nui-demo-basic-combobox");
5768
comboboxDisabled = Atom.find(
@@ -135,7 +146,7 @@ describe("USERCONTROL Combobox >", () => {
135146

136147
it("should change the model after changing the text input", async () => {
137148
const inputText = "Some text";
138-
await comboboxBasic.acceptInput(inputText);
149+
await applySafeType(comboboxBasic, inputText);
139150
expect(await comboboxBasic.getInputValue()).toEqual(inputText);
140151
});
141152

@@ -182,13 +193,13 @@ describe("USERCONTROL Combobox >", () => {
182193

183194
describe("clear on blur >", () => {
184195
it("should clear input on blur if it's value is not in source array", async () => {
185-
await comboClearOnBlur.acceptInput("Not in a source array");
196+
await applySafeType(comboClearOnBlur, "Not in a source array");
186197
await browser.actions().sendKeys(protractor.Key.TAB).perform();
187198
expect(await comboClearOnBlur.getInputValue()).toEqual("");
188199
});
189200

190201
it("should keep input value in input on blur if it's value is in source array", async () => {
191-
await comboClearOnBlur.acceptInput("Item 1");
202+
await applySafeType(comboClearOnBlur, "Item 1");
192203
await browser.actions().sendKeys(protractor.Key.TAB).perform();
193204
expect(await comboClearOnBlur.getInputValue()).toEqual(
194205
"Item 1"
@@ -376,7 +387,7 @@ describe("USERCONTROL Combobox >", () => {
376387
await comboboxSeparators.waitElementVisible();
377388
await comboboxSeparators.toggleMenu();
378389
expect(await comboboxSeparators.getItemsCount()).toEqual(9);
379-
await comboboxSeparators.acceptInput("Item 1");
390+
await applySafeType(comboboxSeparators, "Item 1");
380391
expect(await comboboxSeparators.getItemsCount()).toEqual(3);
381392
});
382393
});
@@ -385,13 +396,13 @@ describe("USERCONTROL Combobox >", () => {
385396
it("should highlight appropriate items in dropdown for combobox with a plain list of items", async () => {
386397
await comboboxBasic.waitElementVisible();
387398
await comboboxBasic.toggleMenu();
388-
await comboboxBasic.acceptInput("Item");
399+
await applySafeType(comboboxBasic, "Item");
389400
await comboboxBasic.toggleMenu();
390401
expect(await comboboxBasic.getHighlightedItemsCount()).toEqual(
391402
15
392403
);
393404
await comboboxBasic.clearText();
394-
await comboboxBasic.acceptInput("Item 1");
405+
await applySafeType(comboboxBasic, "Item 1");
395406
await comboboxBasic.toggleMenu();
396407
expect(await comboboxBasic.getHighlightedItemsCount()).toEqual(
397408
6
@@ -401,13 +412,13 @@ describe("USERCONTROL Combobox >", () => {
401412
it("should highlight appropriate items in dropdown for combobox with groups", async () => {
402413
await comboboxSeparators.waitElementVisible();
403414
await comboboxSeparators.toggleMenu();
404-
await comboboxSeparators.acceptInput("Item");
415+
await applySafeType(comboboxSeparators, "Item");
405416
await comboboxSeparators.toggleMenu();
406417
expect(
407418
await comboboxSeparators.getHighlightedItemsCount()
408419
).toEqual(9);
409420
await comboboxSeparators.clearText();
410-
await comboboxSeparators.acceptInput("Item 1");
421+
await applySafeType(comboboxSeparators, "Item 1");
411422
await comboboxSeparators.toggleMenu();
412423
expect(
413424
await comboboxSeparators.getHighlightedItemsCount()
@@ -428,7 +439,7 @@ describe("USERCONTROL Combobox >", () => {
428439

429440
it("should clear value if it's not in source array and re-render dropdown", async () => {
430441
await comboboxTypeahead.waitElementVisible();
431-
await comboboxTypeahead.acceptInput("Not in a source array");
442+
await applySafeType(comboboxTypeahead, "Not in a source array");
432443
await comboboxWithDisplayValue.toggleMenu();
433444
expect(
434445
await comboboxTypeahead.getSelectedItems().count()

0 commit comments

Comments
 (0)