From 379cfc257a30959fbe8d22c0bb22a35bb61e4450 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Sun, 1 Aug 2021 14:08:03 +0200 Subject: [PATCH] test(e2e): Disable enter and spacebar tests --- test/e2e/specs/CalendarButton.feature | 88 +++++++++++++----------- test/e2e/specs/CalendarButton/index.js | 3 +- test/e2e/specs/CellSelection.feature | 11 +-- test/e2e/specs/ClearButton.feature | 37 +++++----- test/e2e/specs/NextButton.feature | 8 ++- test/e2e/specs/NextButton/index.js | 2 +- test/e2e/specs/PreviousButton.feature | 8 ++- test/e2e/specs/PreviousButton/index.js | 2 +- test/e2e/specs/TypeableCalendar/index.js | 3 +- test/e2e/specs/UpButton.feature | 8 ++- test/e2e/specs/UpButton/index.js | 2 +- 11 files changed, 97 insertions(+), 75 deletions(-) diff --git a/test/e2e/specs/CalendarButton.feature b/test/e2e/specs/CalendarButton.feature index 8029d1ea..a98cc7ab 100644 --- a/test/e2e/specs/CalendarButton.feature +++ b/test/e2e/specs/CalendarButton.feature @@ -33,45 +33,49 @@ Feature: Calendar Button | 4 | open | invalid | closes | cleared | calendar-button | - @id-3 - Scenario: Press the enter key - Given the calendar is closed - When the user presses the enter key - Then the calendar opens - And today's cell has focus - - - @id-4 - Scenario Outline: Press the enter key: typeable, , date - Given the typeable calendar is "" and a "" date is typed - When the user presses the enter key - Then the calendar "" - And the date is "" - And the input has focus - - Examples: - | # | openOrClosed | validity | opensOrCloses | formattedOrCleared | - | 1 | closed | valid | opens | formatted | - | 2 | closed | invalid | opens | cleared | - - - @id-5 - Scenario: Press the space bar - Given the calendar is closed - When the user presses the space bar - Then the calendar opens - And today's cell has focus - - - @id-6 - Scenario Outline: Press the space bar: typeable, , date - Given the typeable calendar is "" and a "" date is typed - When the user presses the space bar - Then the calendar "" - And the date is "" - And the input has focus - - Examples: - | # | openOrClosed | validity | opensOrCloses | formattedOrCleared | - | 1 | closed | valid | opens | formatted | - | 2 | closed | invalid | opens | cleared | +# N.B. These tests have been disabled until native events are supported by Cypress +# See https://github.com/cypress-io/cypress/issues/311 +# and https://github.com/cypress-io/cypress/issues/8267 + +# @id-3 +# Scenario: Press the enter key +# Given the calendar is closed +# When the user presses the enter key +# Then the calendar opens +# And today's cell has focus + + +# @id-4 +# Scenario Outline: Press the enter key: typeable, , date +# Given the typeable calendar is "" and a "" date is typed +# When the user presses the enter key +# Then the calendar "" +# And the date is "" +# And the input has focus +# +# Examples: +# | # | openOrClosed | validity | opensOrCloses | formattedOrCleared | +# | 1 | closed | valid | opens | formatted | +# | 2 | closed | invalid | opens | cleared | + + +# @id-5 +# Scenario: Press the space bar +# Given the calendar is closed +# When the user presses the space bar +# Then the calendar opens +# And today's cell has focus + + +# @id-6 +# Scenario Outline: Press the space bar: typeable, , date +# Given the typeable calendar is "" and a "" date is typed +# When the user presses the space bar +# Then the calendar "" +# And the date is "" +# And the input has focus +# +# Examples: +# | # | openOrClosed | validity | opensOrCloses | formattedOrCleared | +# | 1 | closed | valid | opens | formatted | +# | 2 | closed | invalid | opens | cleared | diff --git a/test/e2e/specs/CalendarButton/index.js b/test/e2e/specs/CalendarButton/index.js index 540363c2..eb188ea9 100644 --- a/test/e2e/specs/CalendarButton/index.js +++ b/test/e2e/specs/CalendarButton/index.js @@ -73,8 +73,7 @@ describe('Calendar button', () => { }) When('the user presses the enter key', () => { - // TODO: Remove arbitrary wait - focusThe('calendar-button').wait(100).type(`{enter}`) + the('calendar-button').type('{enter}') }) Then('the calendar opens', () => { diff --git a/test/e2e/specs/CellSelection.feature b/test/e2e/specs/CellSelection.feature index 61df7181..80473063 100644 --- a/test/e2e/specs/CellSelection.feature +++ b/test/e2e/specs/CellSelection.feature @@ -3,6 +3,9 @@ Feature: Cell Selection I want to select a cell So that I pick a date +# N.B. The enter and space bar tests have been disabled until native events are supported by Cypress +# See https://github.com/cypress-io/cypress/issues/311 +# and https://github.com/cypress-io/cypress/issues/8267 @id-1 Scenario Outline: Select by : minimum view @@ -14,8 +17,8 @@ Feature: Cell Selection Examples: | # | action | | 1 | click | - | 2 | enter | - | 3 | space | +# | 2 | enter | +# | 3 | space | @id-2 @@ -28,5 +31,5 @@ Feature: Cell Selection Examples: | # | action | | 1 | click | - | 2 | enter | - | 3 | space | +# | 2 | enter | +# | 3 | space | diff --git a/test/e2e/specs/ClearButton.feature b/test/e2e/specs/ClearButton.feature index 04e5b5ac..5786e5bf 100644 --- a/test/e2e/specs/ClearButton.feature +++ b/test/e2e/specs/ClearButton.feature @@ -31,20 +31,23 @@ Feature: Clear Button | 1 | closed | | 2 | open | - - @id-3 - Scenario: Press the enter key - Given the calendar is closed and a date is selected - When the user focuses the clear button and presses the enter key - Then the calendar remains closed - And the date is cleared - And the input field has focus - - - @id-4 - Scenario: Press the space bar - Given the calendar is closed and a date is selected - When the user focuses the clear button and presses the space bar - Then the calendar remains closed - And the date is cleared - And the input field has focus +# N.B. These tests have been disabled until native events are supported by Cypress +# See https://github.com/cypress-io/cypress/issues/311 +# and https://github.com/cypress-io/cypress/issues/8267 + +# @id-3 +# Scenario: Press the enter key +# Given the calendar is closed and a date is selected +# When the user focuses the clear button and presses the enter key +# Then the calendar remains closed +# And the date is cleared +# And the input field has focus + + +# @id-4 +# Scenario: Press the space bar +# Given the calendar is closed and a date is selected +# When the user focuses the clear button and presses the space bar +# Then the calendar remains closed +# And the date is cleared +# And the input field has focus diff --git a/test/e2e/specs/NextButton.feature b/test/e2e/specs/NextButton.feature index 8875718e..76c28aa9 100644 --- a/test/e2e/specs/NextButton.feature +++ b/test/e2e/specs/NextButton.feature @@ -4,6 +4,10 @@ Feature: Next Button So that I can navigate to the next page +# N.B. The enter and space bar tests have been disabled until native events are supported by Cypress +# See https://github.com/cypress-io/cypress/issues/311 +# and https://github.com/cypress-io/cypress/issues/8267 + @id-1 Scenario Outline: Select by Given the calendar is open on `Dec 2020` @@ -14,8 +18,8 @@ Feature: Next Button Examples: | # | action | | 1 | click | - | 2 | enter | - | 3 | space | +# | 2 | enter | +# | 3 | space | @id-2 Scenario: Arrow down to tabbable cell diff --git a/test/e2e/specs/NextButton/index.js b/test/e2e/specs/NextButton/index.js index 5e6a151b..f2a241b1 100644 --- a/test/e2e/specs/NextButton/index.js +++ b/test/e2e/specs/NextButton/index.js @@ -21,7 +21,7 @@ describe('Next Button', () => { return } - focusThe('next-button').type(`{${action}}`) + the('next-button').type(`{${action}}`) }) Then('the page is `Jan 2021`', () => { diff --git a/test/e2e/specs/PreviousButton.feature b/test/e2e/specs/PreviousButton.feature index e78df9eb..d9a7be2b 100644 --- a/test/e2e/specs/PreviousButton.feature +++ b/test/e2e/specs/PreviousButton.feature @@ -4,6 +4,10 @@ Feature: Previous Button So that I can navigate to the previous page +# N.B. The enter and space bar tests have been disabled until native events are supported by Cypress +# See https://github.com/cypress-io/cypress/issues/311 +# and https://github.com/cypress-io/cypress/issues/8267 + @id-1 Scenario Outline: Select by Given the calendar is open on `Jan 2021` @@ -14,8 +18,8 @@ Feature: Previous Button Examples: | # | action | | 1 | click | - | 2 | enter | - | 3 | space | +# | 2 | enter | +# | 3 | space | @id-2 Scenario: Arrow down to tabbable cell diff --git a/test/e2e/specs/PreviousButton/index.js b/test/e2e/specs/PreviousButton/index.js index e5fc53dc..097e839c 100644 --- a/test/e2e/specs/PreviousButton/index.js +++ b/test/e2e/specs/PreviousButton/index.js @@ -21,7 +21,7 @@ describe('Previous Button', () => { return } - focusThe('previous-button').type(`{${action}}`) + the('previous-button').type(`{${action}}`) }) Then('the page is `Dec 2020`', () => { diff --git a/test/e2e/specs/TypeableCalendar/index.js b/test/e2e/specs/TypeableCalendar/index.js index f16a5059..bd012d9e 100644 --- a/test/e2e/specs/TypeableCalendar/index.js +++ b/test/e2e/specs/TypeableCalendar/index.js @@ -24,7 +24,8 @@ describe('@id-1: Press the enter key', () => { ) When('the user presses the enter key', () => { - focusThe('input').type(`{enter}`) + // Until Cypress supports native events, we can simulate this by blurring the input first + the('input').blur().type('{enter}') }) Then('the calendar {string}', (opensOrCloses) => { diff --git a/test/e2e/specs/UpButton.feature b/test/e2e/specs/UpButton.feature index a3216826..b8e345c2 100644 --- a/test/e2e/specs/UpButton.feature +++ b/test/e2e/specs/UpButton.feature @@ -4,6 +4,10 @@ Feature: Up Button So that I can navigate to the next view up +# N.B. The enter and space bar tests have been disabled until native events are supported by Cypress +# See https://github.com/cypress-io/cypress/issues/311 +# and https://github.com/cypress-io/cypress/issues/8267 + @id-1 Scenario Outline: Select up button by Given the calendar is open on `Jan 2021` @@ -14,8 +18,8 @@ Feature: Up Button Examples: | # | action | | 1 | click | - | 2 | enter | - | 3 | space | +# | 2 | enter | +# | 3 | space | @id-2 diff --git a/test/e2e/specs/UpButton/index.js b/test/e2e/specs/UpButton/index.js index 24e96417..20064943 100644 --- a/test/e2e/specs/UpButton/index.js +++ b/test/e2e/specs/UpButton/index.js @@ -21,7 +21,7 @@ describe('Up Button', () => { return } - focusThe('up-button').type(`{${action}}`) + the('up-button').type(`{${action}}`) }) Then('the page is `2021`', () => {