Skip to content

Commit

Permalink
test(many): replace ionic buttons in e2e tests with native html butto…
Browse files Browse the repository at this point in the history
…ns (#29422)

Issue number: internal

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
The `ion-button` component is used in several tests to navigate or show
overlays. This causes screenshot diffs in unrelated tests any time the
UI of the `ion-button` is updated.

## What is the new behavior?
Removes the `ion-button` elements from unrelated tests. 

Did not remove the `ion-button`s from the following tests:
- All `ion-button`s in an `ion-buttons` component
- An `ion-button` inside of a menu
- breadcrumbs/test/basic (uses a clear button in a list header, needs to
be moved)
- input/test/slot
- item/test/buttons
- item/test/colors
- item/test/dividers
- item/test/inputs
- item/test/media
- list-header/test/basic
- ripple-effect/test/basic
- router/test/basic
- router/test/guards
- router-outlet/test/basic
- select/test/slot
- textarea/test/slot

Updates the icon/basic test to use the right icon names by comparing
against the v3 names: https://ionicframework.com/docs/v3/ionicons/

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

---------

Co-authored-by: ionitron <[email protected]>
  • Loading branch information
brandyscarney and Ionitron committed May 2, 2024
1 parent ba5cebf commit 0124f3b
Show file tree
Hide file tree
Showing 669 changed files with 1,077 additions and 1,192 deletions.
20 changes: 20 additions & 0 deletions core/scripts/testing/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions core/src/components/action-sheet/test/a11y/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<main class="ion-padding">
<h1>Action Sheet - A11y</h1>

<ion-button id="bothHeaders" onclick="presentBothHeaders()">Both Headers</ion-button>
<ion-button id="subHeaderOnly" onclick="presentSubHeaderOnly()">Subheader Only</ion-button>
<ion-button id="noHeaders" onclick="presentNoHeaders()">No Headers</ion-button>
<ion-button id="customAria" onclick="presentCustomAria()">Custom Aria</ion-button>
<ion-button id="ariaLabelButton" onclick="presentAriaLabelButton()">Aria Label Button</ion-button>
<ion-button id="ariaLabelCancelButton" onclick="presentAriaLabelCancelButton()"
>Aria Label Cancel Button</ion-button
>
<button class="expand" id="bothHeaders" onclick="presentBothHeaders()">Both Headers</button>
<button class="expand" id="subHeaderOnly" onclick="presentSubHeaderOnly()">Subheader Only</button>
<button class="expand" id="noHeaders" onclick="presentNoHeaders()">No Headers</button>
<button class="expand" id="customAria" onclick="presentCustomAria()">Custom Aria</button>
<button class="expand" id="ariaLabelButton" onclick="presentAriaLabelButton()">Aria Label Button</button>
<button class="expand" id="ariaLabelCancelButton" onclick="presentAriaLabelCancelButton()">
Aria Label Cancel Button
</button>
</main>

<script>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 12 additions & 18 deletions core/src/components/action-sheet/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,18 @@
</ion-header>

<ion-content class="ion-padding">
<ion-button expand="block" id="basic" onclick="presentBasic()">Basic</ion-button>
<ion-button expand="block" id="alertFromActionSheet" onclick="presentAlert()"
>Alert from Action Sheet</ion-button
>
<ion-button expand="block" id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</ion-button>
<ion-button expand="block" id="custom" onclick="presentWithCssClass()">Custom CSS Class</ion-button>
<ion-button expand="block" id="icons" onclick="presentIcons()">Icons</ion-button>
<ion-button expand="block" id="noBackdropDismiss" onclick="presentNoBackdropDismiss()"
>No Backdrop Dismiss</ion-button
>
<ion-button expand="block" id="scrollableOptions" onclick="presentScroll()">Scrollable Options</ion-button>
<ion-button expand="block" id="scrollWithoutCancel" onclick="presentScrollNoCancel()"
>Scroll Without Cancel</ion-button
>
<ion-button expand="block" id="customBackdrop" onclick="presentWithCssClass('custom-backdrop')"
>Custom Backdrop Opacity</ion-button
>
<ion-button expand="block" id="buttonData" onclick="presentWithButtonData()">Button data</ion-button>
<button class="expand" id="basic" onclick="presentBasic()">Basic</button>
<button class="expand" id="alertFromActionSheet" onclick="presentAlert()">Alert from Action Sheet</button>
<button class="expand" id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</button>
<button class="expand" id="custom" onclick="presentWithCssClass()">Custom CSS Class</button>
<button class="expand" id="icons" onclick="presentIcons()">Icons</button>
<button class="expand" id="noBackdropDismiss" onclick="presentNoBackdropDismiss()">No Backdrop Dismiss</button>
<button class="expand" id="scrollableOptions" onclick="presentScroll()">Scrollable Options</button>
<button class="expand" id="scrollWithoutCancel" onclick="presentScrollNoCancel()">Scroll Without Cancel</button>
<button class="expand" id="customBackdrop" onclick="presentWithCssClass('custom-backdrop')">
Custom Backdrop Opacity
</button>
<button class="expand" id="buttonData" onclick="presentWithButtonData()">Button data</button>
</ion-content>
</ion-app>

Expand Down
4 changes: 2 additions & 2 deletions core/src/components/action-sheet/test/is-open/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
<div class="grid">
<div class="grid-item">
<h2>Default</h2>
<ion-button id="default" onclick="openActionSheet()">Open ActionSheet</ion-button>
<button id="default" onclick="openActionSheet()">Open ActionSheet</button>
</div>
<div class="grid-item">
<h2>Open, then close after 500ms</h2>
<ion-button id="timeout" onclick="openActionSheet(500)">Open ActionSheet</ion-button>
<button id="timeout" onclick="openActionSheet(500)">Open ActionSheet</button>
</div>
</div>

Expand Down
32 changes: 10 additions & 22 deletions core/src/components/action-sheet/test/standalone/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,16 @@
window.actionSheetController = actionSheetController;
</script>
<body>
<button id="basic" onclick="presentBasic()">Basic</button>
<button id="noBackdropDismiss" onclick="presentNoBackdropDismiss()">No Backdrop Dismiss</button>
<button id="alertFromActionSheet" onclick="presentAlert()">Alert from Action Sheet</button>
<button id="scrollableOptions" onclick="presentScroll()">Scrollable Options</button>
<button id="scrollWithoutCancel" onclick="presentScrollNoCancel()">Scroll Without Cancel</button>
<button id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</button>
<button id="icons" onclick="presentIcons()">Icons</button>
<button id="cssClass" onclick="presentWithCssClass()">Custom CSS Class</button>

<style>
body > button {
display: block;
clear: both;
width: 100%;
padding: 12px 8px;
font-size: 1em;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 4px;
margin-bottom: 8px;
}
</style>
<main>
<button class="expand" id="basic" onclick="presentBasic()">Basic</button>
<button class="expand" id="noBackdropDismiss" onclick="presentNoBackdropDismiss()">No Backdrop Dismiss</button>
<button class="expand" id="alertFromActionSheet" onclick="presentAlert()">Alert from Action Sheet</button>
<button class="expand" id="scrollableOptions" onclick="presentScroll()">Scrollable Options</button>
<button class="expand" id="scrollWithoutCancel" onclick="presentScrollNoCancel()">Scroll Without Cancel</button>
<button class="expand" id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</button>
<button class="expand" id="icons" onclick="presentIcons()">Icons</button>
<button class="expand" id="cssClass" onclick="presentWithCssClass()">Custom CSS Class</button>
</main>

<script>
window.addEventListener('ionActionSheetDidDismiss', function (e) {
Expand Down
106 changes: 50 additions & 56 deletions core/src/components/action-sheet/test/translucent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,50 @@
<script src="../../../../../scripts/testing/scripts.js"></script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>

<style>
f {
display: block;
width: 100%;
height: 150px;
}

.red {
background-color: #ea445a;
}

.green {
background-color: #76d672;
}

.blue {
background-color: #3478f6;
}

.yellow {
background-color: #ffff80;
}

.pink {
background-color: #ff6b86;
}

.purple {
background-color: #7e34f6;
}

.black {
background-color: #000;
}

.fuchsia {
background-color: #cc00ff;
}

.orange {
background-color: #f69234;
}
</style>
</head>
<script type="module">
import { actionSheetController } from '../../../../dist/ionic/index.esm.js';
Expand All @@ -26,18 +70,12 @@
</ion-header>

<ion-content class="ion-padding">
<ion-button expand="block" id="basic" onclick="presentBasic()">Basic</ion-button>
<ion-button expand="block" id="noBackdropDismiss" onclick="presentNoBackdropDismiss()"
>No Backdrop Dismiss</ion-button
>
<ion-button expand="block" id="alertFromActionSheet" onclick="presentAlert()"
>Alert from Action Sheet</ion-button
>
<ion-button expand="block" id="scrollableOptions" onclick="presentScroll()">Scrollable Options</ion-button>
<ion-button expand="block" id="scrollWithoutCancel" onclick="presentScrollNoCancel()"
>Scroll Without Cancel</ion-button
>
<ion-button expand="block" id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</ion-button>
<button class="expand" id="basic" onclick="presentBasic()">Basic</button>
<button class="expand" id="noBackdropDismiss" onclick="presentNoBackdropDismiss()">No Backdrop Dismiss</button>
<button class="expand" id="alertFromActionSheet" onclick="presentAlert()">Alert from Action Sheet</button>
<button class="expand" id="scrollableOptions" onclick="presentScroll()">Scrollable Options</button>
<button class="expand" id="scrollWithoutCancel" onclick="presentScrollNoCancel()">Scroll Without Cancel</button>
<button class="expand" id="cancelOnly" onclick="presentCancelOnly()">Cancel Only</button>

<ion-grid>
<ion-row>
Expand Down Expand Up @@ -345,49 +383,5 @@
});
}
</script>

<style>
f {
display: block;
width: 100%;
height: 150px;
}

.red {
background-color: #ea445a;
}

.green {
background-color: #76d672;
}

.blue {
background-color: #3478f6;
}

.yellow {
background-color: #ffff80;
}

.pink {
background-color: #ff6b86;
}

.purple {
background-color: #7e34f6;
}

.black {
background-color: #000;
}

.fuchsia {
background-color: #cc00ff;
}

.orange {
background-color: #f69234;
}
</style>
</body>
</html>
4 changes: 2 additions & 2 deletions core/src/components/action-sheet/test/trigger/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
<div class="grid">
<div class="grid-item">
<h2>Default</h2>
<ion-button id="default">Open ActionSheet</ion-button>
<button id="default">Open ActionSheet</button>
</div>
<div class="grid-item">
<h2>Open, then close after 500ms</h2>
<ion-button id="timeout">Open ActionSheet</ion-button>
<button id="timeout">Open ActionSheet</button>
</div>
</div>

Expand Down
27 changes: 7 additions & 20 deletions core/src/components/alert/test/a11y/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@
<script src="../../../../../scripts/testing/scripts.js"></script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
<style>
main > button {
display: block;
clear: both;
width: 100%;
padding: 12px 8px;
font-size: 1em;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 4px;
margin-bottom: 8px;
}
</style>
</head>
<script type="module">
import { alertController } from '../../../../dist/ionic/index.esm.js';
Expand All @@ -32,13 +19,13 @@
<main class="ion-padding">
<h1>Alert - A11y</h1>

<button id="bothHeaders" onclick="presentBothHeaders()">Both Headers</button>
<button id="subHeaderOnly" onclick="presentSubHeaderOnly()">Subheader Only</button>
<button id="noHeaders" onclick="presentNoHeaders()">No Headers</button>
<button id="noMessage" onclick="presentNoMessage()">No Message</button>
<button id="customAria" onclick="presentCustomAria()">Custom Aria</button>
<button id="ariaLabelButton" onclick="presentAriaLabelButton()">Aria Label Button</button>
<button id="checkbox" onclick="presentAlertCheckbox()">Checkbox</button>
<button class="expand" id="bothHeaders" onclick="presentBothHeaders()">Both Headers</button>
<button class="expand" id="subHeaderOnly" onclick="presentSubHeaderOnly()">Subheader Only</button>
<button class="expand" id="noHeaders" onclick="presentNoHeaders()">No Headers</button>
<button class="expand" id="noMessage" onclick="presentNoMessage()">No Message</button>
<button class="expand" id="customAria" onclick="presentCustomAria()">Custom Aria</button>
<button class="expand" id="ariaLabelButton" onclick="presentAriaLabelButton()">Aria Label Button</button>
<button class="expand" id="checkbox" onclick="presentAlertCheckbox()">Checkbox</button>
</main>

<script>
Expand Down
34 changes: 12 additions & 22 deletions core/src/components/alert/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,21 @@
</ion-header>

<ion-content class="ion-padding">
<button class="custom-accordion-button" id="basic" onclick="presentAlert()">Alert</button>
<button id="longMessage" onclick="presentAlertLongMessage()">Alert Long Message</button>
<button id="multipleButtons" onclick="presentAlertMultipleButtons()">Multiple Buttons (>2)</button>
<button id="noMessage" onclick="presentAlertNoMessage()">Alert No Message</button>
<button id="asyncHandler" onclick="presentAlertAsyncHandler()">Alert Async Handler</button>
<button id="confirm" onclick="presentAlertConfirm()">Confirm</button>
<button id="prompt" onclick="presentAlertPrompt()">Prompt</button>
<button id="radio" onclick="presentAlertRadio()">Radio</button>
<button id="checkbox" onclick="presentAlertCheckbox()">Checkbox</button>
<button onclick="presentWithCssClass()">CssClass</button>
<button class="expand" class="custom-accordion-button" id="basic" onclick="presentAlert()">Alert</button>
<button class="expand" id="longMessage" onclick="presentAlertLongMessage()">Alert Long Message</button>
<button class="expand" id="multipleButtons" onclick="presentAlertMultipleButtons()">
Multiple Buttons (>2)
</button>
<button class="expand" id="noMessage" onclick="presentAlertNoMessage()">Alert No Message</button>
<button class="expand" id="asyncHandler" onclick="presentAlertAsyncHandler()">Alert Async Handler</button>
<button class="expand" id="confirm" onclick="presentAlertConfirm()">Confirm</button>
<button class="expand" id="prompt" onclick="presentAlertPrompt()">Prompt</button>
<button class="expand" id="radio" onclick="presentAlertRadio()">Radio</button>
<button class="expand" id="checkbox" onclick="presentAlertCheckbox()">Checkbox</button>
<button class="expand" onclick="presentWithCssClass()">CssClass</button>
</ion-content>

<style>
ion-content > button {
display: block;
clear: both;
width: 100%;
padding: 12px 8px;
font-size: 1em;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 4px;
margin-bottom: 8px;
}

.my-custom-class {
--background: lightblue;
--min-width: 0;
Expand Down
17 changes: 2 additions & 15 deletions core/src/components/alert/test/is-open/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
<script src="../../../../../scripts/testing/scripts.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
<style>
ion-content > button {
display: block;
clear: both;
width: 100%;
padding: 12px 8px;
font-size: 1em;
background: #f8f8f8;
border: 1px solid #eee;
border-radius: 4px;
margin-bottom: 8px;
}
</style>
</head>

<body>
Expand All @@ -35,8 +22,8 @@
</ion-header>

<ion-content class="ion-padding">
<button id="default" onclick="openAlert()">Open Alert</button>
<button id="timeout" onclick="openAlert(500)">Open Alert, Close After 500ms</button>
<button class="expand" id="default" onclick="openAlert()">Open Alert</button>
<button class="expand" id="timeout" onclick="openAlert(500)">Open Alert, Close After 500ms</button>

<ion-alert header="Alert" message="Hello World!"></ion-alert>
</ion-content>
Expand Down

0 comments on commit 0124f3b

Please sign in to comment.