Skip to content

Commit

Permalink
Regression Tests: Fix typos in 22 test scripts (Pull #1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Jul 8, 2020
1 parent 7efa6e5 commit b3ec71e
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion test/tests/alert_alert.js
Expand Up @@ -16,7 +16,7 @@ ariaTest('role="alert" on alert element', exampleFile, 'alert-role', async (t) =

t.false(
await t.context.session.findElement(By.css(ex.alertSelector)).isDisplayed(),
'[role="alert"] element found and should not be displayed on pageload'
'[role="alert"] element found and should not be displayed on page load'
);

let alertButton = await t.context.session.findElement(By.css(ex.buttonSelector));
Expand Down
2 changes: 1 addition & 1 deletion test/tests/breadcrumb_index.js
Expand Up @@ -16,7 +16,7 @@ ariaTest('aria-label attribute on nav element', exampleFile, 'aria-label', async
await assertAriaLabelExists(t, ex.breadcrumbSelector);
});

ariaTest('aria-current element should exist on relevent link', exampleFile, 'aria-current', async (t) => {
ariaTest('aria-current element should exist on relevant link', exampleFile, 'aria-current', async (t) => {

let navElement = await t.context.session.findElement(By.css(ex.breadcrumbSelector));
let currentElement = await t.context.queryElements(t, '[aria-current]', navElement);
Expand Down
2 changes: 1 addition & 1 deletion test/tests/carousel_carousel-1.js
Expand Up @@ -33,7 +33,7 @@ const ex = {

ariaTest('section element used to contain slider', exampleFile, 'carousel-region-role', async (t) => {

// This test primarially tests that the ex.landmarkSelector points to a `section` element
// This test primarily tests that the ex.landmarkSelector points to a `section` element
const landmarkEl = await t.context.session.findElement(By.css(ex.landmarkSelector));
t.is(
await landmarkEl.getTagName(),
Expand Down
2 changes: 1 addition & 1 deletion test/tests/combobox_grid-combo.js
Expand Up @@ -98,7 +98,7 @@ ariaTest('"aria-expanded" on combobox element', exampleFile, 'combobox-aria-expa
);
});

ariaTest('"id" attribute on texbox used to discover accessible name', exampleFile, 'combobox-id', async (t) => {
ariaTest('"id" attribute on textbox used to discover accessible name', exampleFile, 'combobox-id', async (t) => {

const labelForTextboxId = await t.context.session
.findElement(By.css(ex.labelSelector))
Expand Down
12 changes: 6 additions & 6 deletions test/tests/dialog-modal_datepicker.js
Expand Up @@ -129,8 +129,8 @@ ariaTest('Roving tab index on dates in gridcell', exampleFile, 'gridcell-button-
let allButtons = await t.context.queryElements(t, ex.allDateButtons);

// test only one element has tabindex="0"
for (let tabableEl = 0; tabableEl < 30; tabableEl++) {
let dateSelected = await focusableButtons[tabableEl].getText();
for (let tabbableEl = 0; tabbableEl < 30; tabbableEl++) {
let dateSelected = await focusableButtons[tabbableEl].getText();

for (let el = 0; el < allButtons.length; el++) {
let date = await allButtons[el].getText();
Expand All @@ -140,13 +140,13 @@ ariaTest('Roving tab index on dates in gridcell', exampleFile, 'gridcell-button-
t.is(
await allButtons[el].getAttribute('tabindex'),
tabindex,
'focus is on day ' + (tabableEl + 1) + ' therefore the button number ' +
'focus is on day ' + (tabbableEl + 1) + ' therefore the button number ' +
el + ' should have tab index set to: ' + tabindex
);
}

// Send the tabindex="0" element the appropriate key to switch focus to the next element
await focusableButtons[tabableEl].sendKeys(Key.ARROW_RIGHT);
await focusableButtons[tabbableEl].sendKeys(Key.ARROW_RIGHT);
}
});

Expand Down Expand Up @@ -249,7 +249,7 @@ ariaTest('Tab should go through all tabbable items, then loop', exampleFile, 'di
);
});

ariaTest('Shift+tab should send focus backwards through diaglog, then loop', exampleFile, 'dialog-shift-tab', async (t) => {
ariaTest('Shift+tab should send focus backwards through dialog, then loop', exampleFile, 'dialog-shift-tab', async (t) => {

await t.context.session.findElement(By.css(ex.buttonSelector)).click();

Expand Down Expand Up @@ -487,7 +487,7 @@ ariaTest('LEFT ARROW moves date previous one', exampleFile, 'grid-left-arrow', a
}
});

ariaTest('Key HOME sends focus to begining of row', exampleFile, 'grid-home', async (t) => {
ariaTest('Key HOME sends focus to beginning of row', exampleFile, 'grid-home', async (t) => {
await t.context.session.findElement(By.css(ex.buttonSelector)).click();
let day = new Date();

Expand Down
8 changes: 4 additions & 4 deletions test/tests/dialog-modal_dialog.js
Expand Up @@ -56,7 +56,7 @@ const openDialog1 = async function (t) {
const dialog = await t.context.session.findElement(By.css('#dialog1'));
assert(
await dialog.isDisplayed(),
'dialog1 should have successfullly openned'
'dialog1 should have successfully opened'
);
};

Expand All @@ -75,7 +75,7 @@ const openDialog2 = async function (t) {
const dialog = await t.context.session.findElement(By.css('#dialog2'));
assert(
await dialog.isDisplayed(),
'dialog2 should have successfullly openned'
'dialog2 should have successfully opened'
);
};

Expand All @@ -94,7 +94,7 @@ const openDialog3 = async function (t) {
const dialog = await t.context.session.findElement(By.css('#dialog3'));
assert(
await dialog.isDisplayed(),
'dialog3 should have successfullly openned'
'dialog3 should have successfully opened'
);
};

Expand All @@ -118,7 +118,7 @@ const openDialog4 = async function (t) {
const dialog = await t.context.session.findElement(By.css('#dialog2'));
assert(
await dialog.isDisplayed(),
'dialog4 should have successfullly openned'
'dialog4 should have successfully opened'
);
};

Expand Down
4 changes: 2 additions & 2 deletions test/tests/feed_feed.js
Expand Up @@ -35,7 +35,7 @@ const navigateToFeed = async function (t) {
};

const waitForArticlesToLoad = async function (t) {
// Wait for artilces to load
// Wait for articles to load
return t.context.session.wait(
async function () {
let element = await t.context.session.findElement(By.css(ex.feedSelector));
Expand Down Expand Up @@ -162,7 +162,7 @@ ariaTest('aria-setsize on article element', exampleFile, 'article-aria-setsize',
await articles[index - 1].getAttribute('aria-setsize'),
(ex.numArticlesLoadedInSet * 2).toString(),
'Article number ' + index + ' does not have aria-setsize set correctly, ' +
'after triggering more artilces to load.'
'after triggering more articles to load.'
);
}
});
Expand Down
28 changes: 14 additions & 14 deletions test/tests/grid_LayoutGrids.js
Expand Up @@ -285,7 +285,7 @@ ariaTest('Right arrow key moves focus', 'grid/LayoutGrids.html', 'key-right-arro
// Find the first focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[0], ex.focusableElements[0]);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + ex.gridcellSelector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + ex.gridcellSelector);
}

// Test focus moves to next element on arrow right
Expand Down Expand Up @@ -334,10 +334,10 @@ ariaTest('Left arrow key moves focus', 'grid/LayoutGrids.html', 'key-left-arrow'
let activeElement = await focusOnOrInCell(t, gridcellElements[lastCellIndex], ex.focusableElements[lastCellIndex]);

if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the last gridcell: ' + ex.gridcellSelector);
throw new Error('Could not focus on element or any descendent in the last gridcell: ' + ex.gridcellSelector);
}

// Test focus moves to preivous cell after arrow left
// Test focus moves to previous cell after arrow left

for (let index = gridcellElements.length - 2; index > -1; index--) {

Expand Down Expand Up @@ -381,10 +381,10 @@ ariaTest('Down arrow key moves focus', 'grid/LayoutGrids.html', 'key-down-arrow'
// Find the first focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[0], ex.focusableElements[0]);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + selector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + selector);
}

// Test focus moves to next row on down arroq
// Test focus moves to next row on down arrow

for (let index = 1; index < gridcellElements.length; index++) {

Expand Down Expand Up @@ -437,7 +437,7 @@ ariaTest('Up arrow key moves focus', 'grid/LayoutGrids.html', 'key-up-arrow', as
let activeElement = await focusOnOrInCell(t, gridcellElements[lastCellIndex], focusableElement);

if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the last gridcell: ' + selector);
throw new Error('Could not focus on element or any descendent in the last gridcell: ' + selector);
}

// Test focus moves to previous row on up arrow
Expand Down Expand Up @@ -491,7 +491,7 @@ ariaTest('PageDown key moves focus', 'grid/LayoutGrids.html', 'key-page-down', a

let activeElement = await focusOnOrInCell(t, gridcellElements[0], focusableElement);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + selector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + selector);
}

// Test focus moves to next element on paging key
Expand Down Expand Up @@ -551,14 +551,14 @@ ariaTest('PageUp key moves focus', 'grid/LayoutGrids.html', 'key-page-up', async
// Find the last focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[lastCellIndex], focusableElement);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the final gridcell: ' + selector);
throw new Error('Could not focus on element or any descendent in the final gridcell: ' + selector);
}

// Test focus moves to next element on paging key

// The final "page" of rows may not contain the maxmium number of rows. In
// The final "page" of rows may not contain the maximum number of rows. In
// this case, the first "Page Up" keypress will involve traversing fewer
// rows than subsequent kepresses.
// rows than subsequent key presses.
const finalPageLength = (gridcellElements.length % jumpBy) || jumpBy;
const penultimate = gridcellElements.length - 1 - finalPageLength;
for (let index = penultimate; index > -1; index -= jumpBy) {
Expand Down Expand Up @@ -602,7 +602,7 @@ ariaTest('Home key moves focus', 'grid/LayoutGrids.html', 'key-home', async (t)
// Find the first focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[0], ex.focusableElements[0]);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + ex.gridcellSelector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + ex.gridcellSelector);
}

// Move the focused element off the first element in the row
Expand Down Expand Up @@ -641,7 +641,7 @@ ariaTest('End key moves focus', 'grid/LayoutGrids.html', 'key-end', async (t) =>
// Find the first focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[0], ex.focusableElements[0]);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + ex.gridcellSelector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + ex.gridcellSelector);
}

// Test focus to last element in row using key END
Expand Down Expand Up @@ -673,7 +673,7 @@ ariaTest('control+home keys moves focus', 'grid/LayoutGrids.html', 'key-control-
// Find the first focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[0], ex.focusableElements[0]);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + ex.gridcellSelector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + ex.gridcellSelector);
}

// Move the focused element off the first element in the row
Expand Down Expand Up @@ -712,7 +712,7 @@ ariaTest('Control+end keys moves focus', 'grid/LayoutGrids.html', 'key-control-e
// Find the first focusable element
let activeElement = await focusOnOrInCell(t, gridcellElements[0], ex.focusableElements[0]);
if (!activeElement) {
throw new Error('Could not focus on element or any decendent in the first gridcell: ' + ex.gridcellSelector);
throw new Error('Could not focus on element or any descendent in the first gridcell: ' + ex.gridcellSelector);
}

// Test focus to last element in row using key CONTROL+END
Expand Down
22 changes: 11 additions & 11 deletions test/tests/grid_dataGrids.js
Expand Up @@ -14,7 +14,7 @@ const ex = {
rowSelector: '#ex1 tr',
lastColumn: 5,
lastRow: 7,
firstInterativeRow: 2
firstInteractiveRow: 2
},
2: {
gridSelector: '#ex2 [role="grid"]',
Expand All @@ -23,15 +23,15 @@ const ex = {
amountHeaderSelector: '#ex2 tr:nth-of-type(1) th:nth-of-type(5)',
lastColumn: 6,
lastRow: 8,
firstInterativeRow: 1
firstInteractiveRow: 1
},
3: {
gridSelector: '#ex3 [role="grid"]',
rowSelector: '#ex3 tr',
hideButtonSelector: '#ex3 #toggle_column_btn',
lastColumn: 6,
lastRow: 16,
firstInterativeRow: 2
firstInteractiveRow: 2
}
};

Expand All @@ -54,7 +54,7 @@ const checkFocusOnOrInCell = async function (t, gridSelector, rowIndex, columnIn
return document.activeElement === cellElement;
}

// Look for an interative element in the gridcell to find candidate for focus
// Look for an interactive element in the gridcell to find candidate for focus
const interactiveElement = cellElement.querySelector('[tabindex]');
return document.activeElement === interactiveElement;

Expand All @@ -72,9 +72,9 @@ const sendKeyToGridcell = async function (t, gridSelector, rowIndex, columnIndex
return await cellElement.sendKeys(key);
}

// Look for an interative element in the gridcell to send KEY
const interativeElement = await cellElement.findElement(By.css('[tabindex]'));
return await interativeElement.sendKeys(key);
// Look for an interactive element in the gridcell to send KEY
const interactiveElement = await cellElement.findElement(By.css('[tabindex]'));
return await interactiveElement.sendKeys(key);
};

const scrollToEndOfExample3 = async function (t) {
Expand Down Expand Up @@ -514,7 +514,7 @@ ariaTest('Key up moves focus, examples 1,2,3', exampleFile, 'key-up-arrow', asyn
await sendKeyToGridcell(t, gridSelector, 2, 1, Key.ARROW_UP);
t.true(
await checkFocusOnOrInCell(t, gridSelector, 1, 1),
'After sending ARROW UP to element the first data row (2) at column 1 the focus should move to the header row (which is interative) in example: ' + example
'After sending ARROW UP to element the first data row (2) at column 1 the focus should move to the header row (which is interactive) in example: ' + example
);
}

Expand Down Expand Up @@ -664,7 +664,7 @@ ariaTest('Control+home moves focus', exampleFile, 'key-control-home', async (t)
const rowSelector = ex[example].rowSelector;
const lastColumn = ex[example].lastColumn;
const lastRow = ex[example].lastRow;
const firstInterativeRow = ex[example].firstInterativeRow;
const firstInteractiveRow = ex[example].firstInteractiveRow;

let columnIndex = 1;

Expand All @@ -684,8 +684,8 @@ ariaTest('Control+home moves focus', exampleFile, 'key-control-home', async (t)
// Test focus moves down
await sendKeyToGridcell(t, gridSelector, rowIndex, columnIndex, Key.chord(Key.CONTROL, Key.HOME));
t.true(
await checkFocusOnOrInCell(t, gridSelector, firstInterativeRow, 1),
'After sending CONTROL+HOME to element in row ' + rowIndex + ' column ' + columnIndex + ', focus should be on element in row ' + firstInterativeRow + ' column 1 for example: ' + example
await checkFocusOnOrInCell(t, gridSelector, firstInteractiveRow, 1),
'After sending CONTROL+HOME to element in row ' + rowIndex + ' column ' + columnIndex + ', focus should be on element in row ' + firstInteractiveRow + ' column 1 for example: ' + example
);

// Switch the column every time
Expand Down
4 changes: 2 additions & 2 deletions test/tests/listbox_collapsible.js
Expand Up @@ -195,7 +195,7 @@ ariaTest('ESCAPE closes listbox', exampleFile, 'key-escape', async (t) => {

ariaTest('DOWN ARROW opens listbox and moves focus', exampleFile, 'key-down-arrow', async (t) => {

// Send DOWN ARROW to button should open listbo
// Send DOWN ARROW to button should open listbox
await t.context.session.findElement(By.css(ex.buttonSelector)).sendKeys(Key.ARROW_DOWN);

// Confirm the listbox is open and in focus
Expand Down Expand Up @@ -247,7 +247,7 @@ ariaTest('END moves focus', exampleFile, 'key-end', async (t) => {

ariaTest('UP ARROW moves focus', exampleFile, 'key-up-arrow', async (t) => {

// Send UP ARROW to button should open listboxx
// Send UP ARROW to button should open listbox
await t.context.session.findElement(By.css(ex.buttonSelector)).sendKeys(Key.ARROW_UP);

// Confirm the listbox is open and in focus
Expand Down
2 changes: 1 addition & 1 deletion test/tests/listbox_rearrangeable.js
Expand Up @@ -342,7 +342,7 @@ ariaTest('shift + click selects multiple options', exampleFile, 'key-shift-up-ar
.keyUp(Key.SHIFT)
.perform();

// expect first through fourt option to be selected
// expect first through fourth option to be selected
for (let index = options.length - 1; index >= 0 ; index--) {
const selected = await options[index].getAttribute('aria-selected');
const shouldBeSelected = index < 4;
Expand Down
10 changes: 5 additions & 5 deletions test/tests/menubar_menubar-1.js
Expand Up @@ -500,7 +500,7 @@ ariaTest('Key HOME goes to first item in menubar', exampleFile, 'menubar-home',
// Test that the focus is on the first item in the list
t.true(
await checkFocus(t, ex.menubarMenuitemSelector, 0),
'Sending key "HOME" to menuitem ' + menuIndex + ' in menubar should move the foucs to the first menuitem'
'Sending key "HOME" to menuitem ' + menuIndex + ' in menubar should move the focus to the first menuitem'
);
}
});
Expand All @@ -521,7 +521,7 @@ ariaTest('Key END goes to last item in menubar', exampleFile, 'menubar-end', asy
// Test that the focus is on the last item in the list
t.true(
await checkFocus(t, ex.menubarMenuitemSelector, ex.numMenus - 1),
'Sending key "END" to menuitem ' + menuIndex + ' in menubar should move the foucs to the last menuitem'
'Sending key "END" to menuitem ' + menuIndex + ' in menubar should move the focus to the last menuitem'
);
}
});
Expand All @@ -546,7 +546,7 @@ ariaTest('Character sends to menubar changes focus in menubar',
// Test that the focus switches to the appropriate menuitem
t.true(
await checkFocus(t, ex.menubarMenuitemSelector, test.endIndex),
'Sending characther ' + test.sendChar + ' to menuitem ' + test.sendIndex + ' in menubar should move the foucs to menuitem ' + test.endIndex
'Sending character ' + test.sendChar + ' to menuitem ' + test.sendIndex + ' in menubar should move the focus to menuitem ' + test.endIndex
);
}
});
Expand Down Expand Up @@ -1175,7 +1175,7 @@ ariaTest('Character sends to menubar changes focus in menubar', exampleFile, 'su
// Test that the focus switches to the appropriate menuitem
t.true(
await checkFocus(t, ex.menuMenuitemSelectors[menuIndex], test.endIndex),
'Sending characther ' + test.sendChar + ' to menuitem ' + itemText + ' should move the focus to menuitem ' + test.endIndex
'Sending character ' + test.sendChar + ' to menuitem ' + itemText + ' should move the focus to menuitem ' + test.endIndex
);
}
}
Expand Down Expand Up @@ -1217,7 +1217,7 @@ ariaTest('Character sends to menubar changes focus in menubar', exampleFile, 'su
// Test that the focus switches to the appropriate menuitem
t.true(
await checkFocus(t, submenuMenuitemSelector, test.endIndex),
'Sending characther ' + test.sendChar + ' to menuitem ' + itemText + ' should move the focus to menuitem ' + test.endIndex
'Sending character ' + test.sendChar + ' to menuitem ' + itemText + ' should move the focus to menuitem ' + test.endIndex
);
}

Expand Down

0 comments on commit b3ec71e

Please sign in to comment.