Browse Source

Update e2e identifiers to prevent React warning

Also, remove screenshots while e2e testing because not used for now.
master
meriadec 6 years ago
parent
commit
7bac09bb65
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 6
      src/components/DashboardPage/EmptyState.js
  2. 2
      src/components/Onboarding/OnboardingFooter.js
  3. 2
      src/components/Onboarding/steps/Analytics.js
  4. 4
      src/components/Onboarding/steps/Finish.js
  5. 2
      src/components/SettingsPage/DevModeButton.js
  6. 2
      src/components/SettingsPage/index.js
  7. 2
      src/components/TopBar/index.js
  8. 4
      src/components/modals/Disclaimer.js
  9. 31
      test-e2e/nav_to_settings.spec.js

6
src/components/DashboardPage/EmptyState.js

@ -45,7 +45,7 @@ class EmptyState extends PureComponent<Props, *> {
height="157"
/>
<Box mt={5} alignItems="center">
<Title data-e2eId="dashboard_empty_title">{t('app:emptyState.dashboard.title')}</Title>
<Title data-e2e="dashboard_empty_title">{t('app:emptyState.dashboard.title')}</Title>
<Description mt={3} style={{ maxWidth: 600 }}>
{t('app:emptyState.dashboard.desc')}
</Description>
@ -54,7 +54,7 @@ class EmptyState extends PureComponent<Props, *> {
primary
style={{ minWidth: 120 }}
onClick={this.handleInstallApp}
data-e2eId="dashboard_empty_OpenManager"
data-e2e="dashboard_empty_OpenManager"
>
{t('app:emptyState.dashboard.buttons.installApp')}
</Button>
@ -62,7 +62,7 @@ class EmptyState extends PureComponent<Props, *> {
outline
style={{ minWidth: 120 }}
onClick={() => openModal(MODAL_ADD_ACCOUNTS)}
data-e2eId="dashboard_empty_AddAccounts"
data-e2e="dashboard_empty_AddAccounts"
>
{t('app:emptyState.dashboard.buttons.addAccount')}
</Button>

2
src/components/Onboarding/OnboardingFooter.js

@ -27,7 +27,7 @@ const OnboardingFooter = ({
{t('app:common.back')}
</Button>
<Button
data-e2eId="continue_button"
data-e2e="continue_button"
disabled={isContinueDisabled}
primary
onClick={() => nextStep()}

2
src/components/Onboarding/steps/Analytics.js

@ -70,7 +70,7 @@ class Analytics extends PureComponent<StepProps, State> {
deviceType={onboarding.isLedgerNano ? 'Nano S' : 'Blue'}
/>
<StepContainerInner>
<Title data-e2eId="onboarding_title">{t('onboarding:analytics.title')}</Title>
<Title data-e2e="onboarding_title">{t('onboarding:analytics.title')}</Title>
<Description>{t('onboarding:analytics.desc')}</Description>
<Box mt={5}>
<Container>

4
src/components/Onboarding/steps/Finish.js

@ -103,11 +103,11 @@ export default class Finish extends Component<StepProps, *> {
</Box>
<Box pt={5} align="center">
<Title data-e2eId="finish_title">{t('onboarding:finish.title')}</Title>
<Title data-e2e="finish_title">{t('onboarding:finish.title')}</Title>
<Description>{t('onboarding:finish.desc')}</Description>
</Box>
<Box p={5}>
<Button primary onClick={() => finish()} data-e2eId="continue_button">
<Button primary onClick={() => finish()} data-e2e="continue_button">
{t('onboarding:finish.openAppButton')}
</Button>
</Box>

2
src/components/SettingsPage/DevModeButton.js

@ -27,7 +27,7 @@ class DevModeButton extends PureComponent<Props> {
return (
<Fragment>
<Track onUpdate event={developerMode ? 'DevModeEnabled' : 'DevModeDisabled'} />
<Switch isChecked={developerMode} onChange={setDeveloperMode} data-e2eId="devMode_button" />
<Switch isChecked={developerMode} onChange={setDeveloperMode} data-e2e="devMode_button" />
</Fragment>
)
}

2
src/components/SettingsPage/index.js

@ -106,7 +106,7 @@ class SettingsPage extends PureComponent<Props, State> {
return (
<Box pb={4} selectable>
<Box ff="Museo Sans|Regular" color="dark" fontSize={7} mb={5} data-e2eId="settings_title">
<Box ff="Museo Sans|Regular" color="dark" fontSize={7} mb={5} data-e2e="settings_title">
{t('app:settings.title')}
</Box>
<Pills mb={4} items={items} activeKey={tab.key} onChange={this.handleChangeTab} />

2
src/components/TopBar/index.js

@ -109,7 +109,7 @@ class TopBar extends PureComponent<Props> {
</Box>
</Fragment>
)}
<Tooltip render={() => t('app:settings.title')} data-e2eId="setting_button">
<Tooltip render={() => t('app:settings.title')} data-e2e="setting_button">
<ItemContainer isInteractive onClick={this.navigateToSettings}>
<IconSettings size={16} />
</ItemContainer>

4
src/components/modals/Disclaimer.js

@ -25,7 +25,7 @@ class DisclaimerModal extends PureComponent<Props> {
name={MODAL_DISCLAIMER}
render={({ onClose }) => (
<ModalBody onClose={onClose}>
<ModalTitle data-e2eId="disclaimer_title">{t('app:disclaimerModal.title')}</ModalTitle>
<ModalTitle data-e2e="disclaimer_title">{t('app:disclaimerModal.title')}</ModalTitle>
<ModalContent flow={4} ff="Open Sans|Regular" fontSize={4} color="smoke">
<Box align="center" mt={4} pb={4}>
<HandShield size={55} />
@ -34,7 +34,7 @@ class DisclaimerModal extends PureComponent<Props> {
<p>{t('app:disclaimerModal.desc_2')}</p>
</ModalContent>
<ModalFooter horizontal justifyContent="flex-end">
<Button data-e2eId="continue_button" onClick={onClose} primary>
<Button data-e2e="continue_button" onClick={onClose} primary>
{t('app:disclaimerModal.cta')}
</Button>
</ModalFooter>

31
test-e2e/nav_to_settings.spec.js

@ -28,45 +28,36 @@ describe('Application launch', () => {
expect(title).toEqual('Ledger Live')
await app.client.waitUntilWindowLoaded()
await app.client.pause(2000)
/* await app.client.waitUntil(function(){
return app.client.getText('//*[@id="app"]/div/div/div/div[1]/div/div/div[3]/div[1]/div[1]/div[1]/div[1]') === 'Technical data *'
}, 2000, 'Test', 200)
*/
// Post Onboarding
const title_onboarding = await app.client.getText('[data-e2eId=onboarding_title]')
const title_onboarding = await app.client.getText('[data-e2e=onboarding_title]')
expect(title_onboarding).toEqual('Analytics and bug reports')
await app.client.saveScreenshot('./test-e2e/snap_Start.png')
await app.client.click('[data-e2eId=continue_button]')
await app.client.click('[data-e2e=continue_button]')
await app.client.pause(1000)
const title_finish = await app.client.getText('[data-e2eId=finish_title]')
const title_finish = await app.client.getText('[data-e2e=finish_title]')
expect(title_finish).toEqual('Your device is ready!')
await app.client.saveScreenshot('./test-e2e/snap_Finish.png')
await app.client.click('[data-e2eId=continue_button]')
await app.client.click('[data-e2e=continue_button]')
await app.client.pause(1000)
const title_disclaimer = await app.client.getText('[data-e2eId=disclaimer_title]')
const title_disclaimer = await app.client.getText('[data-e2e=disclaimer_title]')
expect(title_disclaimer).toEqual('Trade safely')
await app.client.saveScreenshot('./test-e2e/snap_Disclaimer.png')
await app.client.click('[data-e2eId=continue_button]')
await app.client.click('[data-e2e=continue_button]')
await app.client.pause(1000)
// Dashboard EmptyState
const title_dashboard_empty = await app.client.getText('[data-e2eId=dashboard_empty_title]')
const title_dashboard_empty = await app.client.getText('[data-e2e=dashboard_empty_title]')
expect(title_dashboard_empty).toEqual('Add accounts to your portfolio')
await app.client.saveScreenshot('./test-e2e/snap_emptyState.png')
// Open Settings
await app.client.click('[data-e2eId=setting_button]')
await app.client.click('[data-e2e=setting_button]')
await app.client.pause(1000)
const title_settings = await app.client.getText('[data-e2eId=settings_title]')
const title_settings = await app.client.getText('[data-e2e=settings_title]')
expect(title_settings).toEqual('Settings')
await app.client.saveScreenshot('./test-e2e/snap_settings.png')
// DevMode ON
await app.client.click('[data-e2eId=devMode_button]')
await app.client.click('[data-e2e=devMode_button]')
await app.client.pause(500)
await app.client.saveScreenshot('./test-e2e/snap_settings_devMode.png')
},
TIMEOUT,
)

Loading…
Cancel
Save