Skip to content

Commit

Permalink
test(UI): adapt tests to include new DataMapper tab
Browse files Browse the repository at this point in the history
  • Loading branch information
djelinek committed Dec 10, 2024
1 parent d52c8a3 commit 8eecef1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion it-tests/SwitchBetweenTabs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ describe('Switching between editor tabs', function () {
tabText: 'pf-v5-c-tabs__item-text',
designTabLabel: 'Design canvas',
beansTabLabel: 'Beans editor',
dataMapperTabLabel: 'DataMapper',
},
DesignCanvas: {
canvas: 'topology'
},
BeansEditor: {
listView: 'metadata-editor-modal-list-view',
detailsView: 'metadata-editor-modal-details-view'
},
DataMapper: {
howTo: 'pf-v5-l-bullseye datamapper-howto'
}
}

Expand All @@ -46,7 +50,7 @@ describe('Switching between editor tabs', function () {
driver,
true
)).kaotoWebview;
expect(await getTabsCount()).to.equal(2);
expect(await getTabsCount()).to.equal(3);
expect(await getActiveTabName()).to.equal('Design');
});

Expand All @@ -56,6 +60,12 @@ describe('Switching between editor tabs', function () {
expect(await getActiveTabName()).to.equal('Beans');
});

it('Switch to "DataMapper" tab and check it is active', async function () {
await switchToTab(locators.EditorTabs.dataMapperTabLabel);
await waitForDataMapperIsLoaded();
expect(await getActiveTabName()).to.equal('DataMapper');
});

it('Switch back to "Design" tab and check it is active', async function () {
await switchToTab(locators.EditorTabs.designTabLabel);
await waitForDesignCanvasIsLoaded();
Expand Down Expand Up @@ -98,4 +108,10 @@ describe('Switching between editor tabs', function () {
5_000, 'Beans "details" view was not loaded properly!'
);
}

async function waitForDataMapperIsLoaded() {
await driver.wait(until.elementLocated(By.className(locators.DataMapper.howTo)),
5_000, 'DataMapper "howTo" content was not loaded properly!'
);
}
});

0 comments on commit 8eecef1

Please sign in to comment.