-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from distante/chore/update-cypress-and-ionic
Chore/update cypress and ionic
- Loading branch information
Showing
23 changed files
with
7,376 additions
and
3,858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ html | |
scripts/ | ||
docs/ | ||
**/.eslintrc.js | ||
commitlint.config.js | ||
commitlint.config.js | ||
cypress.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
includeShadowDom: true, | ||
projectId: '1tfaog', | ||
e2e: { | ||
// We've imported your old cypress plugins here. | ||
// You may want to clean this up later by importing these. | ||
setupNodeEvents(on, config) { | ||
return require('./cypress/plugins/index.ts')(on, config); | ||
}, | ||
baseUrl: 'http://localhost:3999/', | ||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}', | ||
experimentalRunAllSpecs: true, | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { ionInputCypress } from '@lib'; | ||
import * as testHelpers from '../../../test-helpers/test-helpers.js'; | ||
|
||
describe('Ion Input', () => { | ||
const selectors = [ | ||
'.external-label ion-input', | ||
'.internal-label ion-input', | ||
'.internal-label ion-input', | ||
'.internal-aria-label ion-input', | ||
]; | ||
|
||
selectors.forEach((selector) => { | ||
describe(selector, () => { | ||
beforeEach(() => { | ||
cy.visit('./ion-input.html'); | ||
}); | ||
|
||
it('can be written on by string selector', () => { | ||
cy.get(`${selector}.hydrated`) | ||
.first() | ||
.then(($ionInput) => { | ||
const element = $ionInput[0]; | ||
const wantedText = testHelpers.convertToTestString( | ||
element.innerText | ||
); | ||
|
||
ionInputCypress.write(selector, wantedText).then(() => { | ||
const inputElement = element.querySelector('input')?.value; | ||
|
||
expect(inputElement).to.eq(wantedText); | ||
}); | ||
}); | ||
}); | ||
|
||
it('can be cleared', () => { | ||
cy.get(`${selector}.hydrated`) | ||
.first() | ||
.then(($ionInput) => { | ||
const element = $ionInput[0]; | ||
|
||
ionInputCypress | ||
.write(selector, 'i am not clear here :)') | ||
.then(() => { | ||
return ionInputCypress.clear(selector); | ||
}) | ||
.then(() => { | ||
const inputElement = element.querySelector('input')?.value; | ||
|
||
expect(inputElement).to.eq(''); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands'; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineCustomElements } from '/node_modules/@ionic/core/dist/esm/loader.js'; | ||
import { convertToTestString } from '/test-helpers/test-helpers.js'; | ||
|
||
defineCustomElements(window).then(() => { | ||
/* Ionic is loaded! */ | ||
|
||
// ------ ION RANGE ----- // | ||
const ranges = document.querySelectorAll('ion-range'); | ||
const rangesIntervals = new Array(ranges.length); | ||
document.querySelectorAll('ion-range').forEach((ionRange, i) => { | ||
ionRange.addEventListener('ionChange', (event) => { | ||
// console.log('ionRange ionChange event', event); | ||
clearInterval(rangesIntervals[i]); | ||
const targetIonRange = event.target; | ||
|
||
rangesIntervals[i] = setInterval(() => { | ||
const slot = | ||
targetIonRange.shadowRoot.querySelector('slot[name="end"]'); | ||
if (!slot) { | ||
return; | ||
} | ||
|
||
clearInterval(rangesIntervals[i]); | ||
rangesIntervals[i] = undefined; | ||
|
||
let eventValue = event.detail.value; | ||
|
||
if (typeof eventValue === 'object') { | ||
eventValue = `${eventValue.lower}/${eventValue.upper}`; | ||
} | ||
|
||
slot.assignedNodes()[0].innerText = eventValue; | ||
}, 100); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { defineCustomElements } from '/node_modules/@ionic/core/dist/esm/loader.js'; | ||
|
||
defineCustomElements(window).then(() => { | ||
/* Ionic is loaded! */ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,8 @@ main { | |
max-width: 500px; | ||
width: 80%; | ||
} | ||
|
||
h1, | ||
h2 { | ||
color: white; | ||
} |
Oops, something went wrong.