Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
wdio tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sugan G authored and Sugan G committed May 14, 2024
1 parent 8a536e2 commit 0784f7d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class DrillInExample extends React.Component {
{ key: 'submenu2', text: 'Hospital events' },
{
key: 'submenu3', text: 'Hospital Accommodations', isDisabled: true,
// key: 'submenu3', text: 'Hospital Accommodations',
},
{ key: 'submenu4', text: 'Hospital Careers' },
{ key: 'submenu5', text: 'Hospital Info', childKeys: [] },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,63 @@ Terra.describeViewports('Navigation Side Menu', ['medium'], () => {
});
});
});

Terra.describeViewports('DrillIn View', ['medium'], () => {
describe('DrillIn display', () => {
it('Default DrillIn view display', () => {
browser.url('/#/raw/tests/cerner-terra-framework-docs/navigation-side-menu/drill-in');
$('#test-menu').waitForDisplayed();
Terra.validates.element('drill-in display', { selector: '#test-menu' });
});
});

describe('Hover DrillIn display', () => {
it('Hover DrillIn display', () => {
browser.url('/#/raw/tests/cerner-terra-framework-docs/navigation-side-menu/drill-in');
$('#test-menu').waitForDisplayed();
$('#test-menu #test-item-1').moveTo();
Terra.validates.element('hover drill-in display', { selector: '#test-menu' });
});
});

describe('Selected DrillIn display', () => {
it('Selected DrillIn display', () => {
browser.url('/#/raw/tests/cerner-terra-framework-docs/navigation-side-menu/drill-in');
$('#test-menu').waitForDisplayed();
$('#test-menu #test-item-1').moveTo();
$('#test-menu #test-item-1').click();
$('#test-menu #test-item-2').click();
Terra.validates.element('selected drill-in display', { selector: '#test-menu' });
});
});

describe('DrillIn keyboard Navigation using Arrow Keys', () => {
before(() => browser.url('/#/raw/tests/cerner-terra-framework-docs/navigation-side-menu/drill-in'));

it('Navigates to first DrillIn item', () => {
browser.keys(['Tab', 'ArrowDown']);
Terra.validates.element('first drill-in item focused', { selector: '#root' });
});

it('Navigate into folder with right arrow', () => {
browser.keys(['ArrowRight']);
Terra.validates.element('displays drill-in items in folder with right arrow', { selector: '#root' });
});

it('Navigate to DrillIn item with left arrow', () => {
browser.keys(['ArrowDown', 'ArrowLeft']);
Terra.validates.element('first drill-in item focused with left arrow', { selector: '#root' });
});

it('should focus on second DrillIn item', () => {
browser.keys(['ArrowDown']);
Terra.validates.element('second drill-in item focused', { selector: '#root' });
});

it('Navigate into folder with no items', () => {
browser.keys(['ArrowDown', 'ArrowDown', 'ArrowDown', 'ArrowRight']);
Terra.validates.element('displays no results status', { selector: '#root' });
});
});
});

0 comments on commit 0784f7d

Please sign in to comment.