From 80bb4e6f78121b3fc03747589b5e9aee4bf32901 Mon Sep 17 00:00:00 2001 From: Ivan Kabir Date: Mon, 8 Jul 2024 10:49:39 +0300 Subject: [PATCH] fix: fix tests --- .../components/controls/control-button.tsx | 2 +- .../controls/strict-match-filter-input.jsx | 2 +- .../controls/test-name-filter-input.jsx | 2 +- .../chromium/header.png | Bin 3328 -> 3328 bytes .../tests/common-tinder/index.testplane.js | 16 ++++++++-------- .../controls/browser-list/index.jsx | 13 +++++++------ 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/static/components/controls/control-button.tsx b/lib/static/components/controls/control-button.tsx index 560957e7f..73f992d30 100644 --- a/lib/static/components/controls/control-button.tsx +++ b/lib/static/components/controls/control-button.tsx @@ -58,7 +58,7 @@ export default class ControlButton extends Component { onClick={handler} className={className} disabled={isDisabled} - data-test-id={dataTestId} + qa={dataTestId?.toString()} > {label} ; diff --git a/lib/static/components/controls/strict-match-filter-input.jsx b/lib/static/components/controls/strict-match-filter-input.jsx index 9ab2cac65..6d70d4302 100644 --- a/lib/static/components/controls/strict-match-filter-input.jsx +++ b/lib/static/components/controls/strict-match-filter-input.jsx @@ -18,7 +18,7 @@ const StrictMatchFilterInput = ({strictMatchFilter, actions}) => { }; return ( - + ); }; diff --git a/lib/static/components/controls/test-name-filter-input.jsx b/lib/static/components/controls/test-name-filter-input.jsx index 57a814fb9..78f7c23f2 100644 --- a/lib/static/components/controls/test-name-filter-input.jsx +++ b/lib/static/components/controls/test-name-filter-input.jsx @@ -29,7 +29,7 @@ const TestNameFilterInput = ({actions, testNameFilter: testNameFilterProp}) => { value={testNameFilter} placeholder="Filter by test name or regexp" onChange={onChange} - data-test-id="header-test-name-filter" + qa="header-test-name-filter" /> ); }; diff --git a/test/func/fixtures/playwright/tests/screens/failed-describe-test-without-screenshot/chromium/header.png b/test/func/fixtures/playwright/tests/screens/failed-describe-test-without-screenshot/chromium/header.png index e2c552fe05f74171908d81695717403b12c966d0..236088d2e7879031410cf59359853a546420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cz9+jSY z7d4Hb)&AonLBIC=304$PO|#kjzU8fd1{lB&XF^3q1-tUyN!VksCI<;=%v<~$af*tA z*R+cTyKtXutpi^Xi=8Jh#v~2#h_>bZHG$0OX}2O9{oL0xP6vAH>+5rS#D4mn{6(hY z5ij`93I68l=6F1l$&@(i4i%U%P)OuGRotUTD=-NO3FEw_uv6Zo@9qcpzXLh-&S5?V zLX%z62^b@&0Y9Ytl8 zm96fQ{;#6xNTXin+qZTbQ6tPQ9NDJ4yj(^`W^Fjgq=DC4>HtpQAN5EK1AH&xy6zpy z=$t0bf;uh{vn&YjdZdc&f20cW2L$UED&4N5P!9I?7rne>Wo7kzn?81>5(Xy5$H zCfP1J(C~l&4F>V$%hTq7Id^I5ovyAfwv9|ClStt~K_@gdzjxf-qZi)jBdu~qL;Ni` zxdQ_$kfEfNmB=maVqNQ063Kx6#YRm^R0P`G%1ZA6c7?8UuC$&;qfx0A=H`U`tjJAo zM531PD>(4GNu$&#_T*&1ty`uUZQBd2QmM%sZ84lYU>g_g;_STF_Ox;)2siGOY&tjz z(o14z`?TnG-@yL0bxg%W*1^HSR5`Qx^V5O?{jF%$2RUxGS+&Yva%D;<0^U&dwh|ptJCJD|!3b*;)CFPUbp?!&&gAvsTEc&nx4+PD { beforeEach(async ({browser}) => { const testFullName = await browser.$('span[data-test-id="screenshot-accepter-test-name"]').getText(); - const acceptButton = await browser.$('button[data-test-id="screenshot-accepter-accept"]'); + const acceptButton = await browser.$('button[data-qa="screenshot-accepter-accept"]'); await acceptButton.click(); await browser.waitUntil(async () => { @@ -55,13 +55,13 @@ describe('Tinder mode', () => { return progress === '1/2'; }, {interval: 100}); - const switchAcceptModeButton = await browser.$('button[data-test-id="screenshot-accepter-switch-accept-mode"]'); + const switchAcceptModeButton = await browser.$('button[data-qa="screenshot-accepter-switch-accept-mode"]'); await switchAcceptModeButton.click(); - const testNameFilterInput = await browser.$('input[data-test-id="header-test-name-filter"]'); + const testNameFilterInput = await browser.$('//*[@data-qa="header-test-name-filter"]//input'); await testNameFilterInput.setValue(testFullName); - await browser.$('div[data-test-id="header-strict-match"]').click(); + await browser.$('*[data-qa="header-strict-match"]').click(); await waitForFsChanges(screensDir); }); @@ -74,7 +74,7 @@ describe('Tinder mode', () => { }); it('should make the test pass on next run', async ({browser}) => { - const retryButton = await browser.$('button[data-test-id="test-retry"]'); + const retryButton = await browser.$('button[data-qa="test-retry"]'); // TODO: find a correct sign to wait for. Issue is that retry button is totally clickable, but doesn't // work right away after switch accept mode and applying filtering for some reason. @@ -93,7 +93,7 @@ describe('Tinder mode', () => { describe(`undo accepting screenshot`, () => { it('should leave project files intact', async ({browser}) => { - const acceptButton = await browser.$('button[data-test-id="screenshot-accepter-accept"]'); + const acceptButton = await browser.$('button[data-qa="screenshot-accepter-accept"]'); await acceptButton.click(); await browser.waitUntil(async () => { @@ -105,7 +105,7 @@ describe('Tinder mode', () => { await waitForFsChanges(screensDir); const fsDiffBeforeUndo = getFsDiffFromVcs(screensDir); - const undoButton = await browser.$('button[data-test-id="screenshot-accepter-undo"]'); + const undoButton = await browser.$('button[data-qa="screenshot-accepter-undo"]'); await undoButton.click(); await waitForFsChanges(screensDir, (output) => output.length === 0); @@ -118,7 +118,7 @@ describe('Tinder mode', () => { }); it('should show success screen after accepting all screenshots', async ({browser}) => { - const acceptButton = await browser.$('button[data-test-id="screenshot-accepter-accept"]'); + const acceptButton = await browser.$('button[data-qa="screenshot-accepter-accept"]'); for (let i = 1; i <= 2; i++) { await acceptButton.click(); diff --git a/test/unit/lib/static/components/controls/browser-list/index.jsx b/test/unit/lib/static/components/controls/browser-list/index.jsx index 3b2396152..399bda296 100644 --- a/test/unit/lib/static/components/controls/browser-list/index.jsx +++ b/test/unit/lib/static/components/controls/browser-list/index.jsx @@ -62,24 +62,25 @@ describe('', () => { available: [ {id: 'bro'}, {id: 'bro1', versions: ['v1']}, - {id: 'bro2', versions: ['v1', 'v2']} + {id: 'bro2', versions: ['v1', 'v2', 'v3']} ], selected: [ {id: 'bro'}, {id: 'bro1', versions: ['v1']}, - {id: 'bro2', versions: ['v1']} + {id: 'bro2', versions: ['v1', 'v2', 'v3']} ], onChange: sandbox.spy() }; const component = mount(); component.first().find('.g-select-control__button').simulate('click'); - component.first().find('.g-select-list__item').first().simulate('click'); + component.first().find('.g-popup .g-select-list__option').last().simulate('click'); - assert.equal(props.onChange.callCount, 1); - assert.deepEqual(props.onChange.firstCall.lastArg, [ + assert.equal(props.onChange.callCount, 2); + assert.deepEqual(props.onChange.lastCall.lastArg, [ {id: 'bro', versions: []}, - {id: 'bro1', versions: ['v1']} + {id: 'bro1', versions: ['v1']}, + {id: 'bro2', versions: ['v1', 'v2']} ]); }); });