How to use the ember-cli-page-object.triggerable function in ember-cli-page-object

To help you get started, we’ve selected a few ember-cli-page-object examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github code-corps / code-corps-ember / tests / pages / components / skills-typeahead.js View on Github external
pressEscKey: triggerable('keydown', 'input', {
    eventProperties: {
      keyCode : 27,
      which   : 27
    }
  }),

  pressRKey: triggerable('keydown', 'input', {
    eventProperties: {
      keyCode : 82,
      which   : 82
    }
  }),

  pressUpKey: triggerable('keydown', 'input', {
    eventProperties: {
      keyCode : 38,
      which   : 38
    }
  })
};
github ilios / frontend / tests / pages / components / global-search-box.js View on Github external
scope: '[data-test-global-search-box]',
  input: fillable('input'),
  inputValue: value('input'),
  inputHasFocus: is(':focus', 'input'),
  triggerInput: triggerable('keyup', 'input'),
  clickIcon: clickable('[data-test-search-icon]'),
  autocompleteResults: collection('[data-test-autocomplete] li'),
  resultsRow1HasActiveClass: hasClass('active', 'li:nth-child(1)'),
  resultsRow2HasActiveClass: hasClass('active', 'li:nth-child(2)'),
  resultsRow3HasActiveClass: hasClass('active', 'li:nth-child(3)'),
  keyUp: {
    scope: '[data-test-input]',
    enter: triggerable('keyup', '', { eventProperties: { key: 'Enter' } }),
    down: triggerable('keyup', '', { eventProperties: { key: 'ArrowDown' } }),
    up: triggerable('keyup', '', { eventProperties: { key: 'ArrowUp' } }),
    escape: triggerable('keyup', '', { eventProperties: { key: 'Escape' } }),
  }
};

export default definition;
export const component = create(definition);
github code-corps / code-corps-ember / tests / pages / onboarding.js View on Github external
text,
  triggerable,
  visitable
} from 'ember-cli-page-object';
import imageDrop from 'code-corps-ember/tests/pages/components/image-drop';
import navMenu from './components/navigation-menu';
import skillsTypeahead from './components/skills-typeahead';

export default create({
  start: visitable('/start'),
  interests: visitable('/start/interests'),
  skills: visitable('/start/skills'),
  expertise: visitable('/start/expertise'),

  firstName: fillable('[name="firstName"]'),
  firstNameEnter: triggerable('keyup', '[name="firstName"]', { eventProperties: { keyCode: 13 } }),
  lastName: fillable('[name="lastName"]'),
  lastNameEnter: triggerable('keyup', '[name="lastName"]', { eventProperties: { keyCode: 13 } }),
  clickCategoryItem: clickable('.category-item button'),

  footer: {
    scope: '.site-footer'
  },

  startButton: {
    scope: '.hello__column--name-input button',
    isDisabled: attribute('disabled')
  },

  startFooterButton: {
    scope: '.start__footer button',
    isDisabled: attribute('disabled')
github code-corps / code-corps-ember / tests / pages / components / create-comment-form.js View on Github external
clickable,
  collection,
  fillable,
  isVisible,
  triggerable
} from 'ember-cli-page-object';

export default {
  scope: '.create-comment-form',

  clickSave: clickable('button[name=save]'),

  editor: {
    scope: '.editor-with-preview',

    hitCtrlEnter: triggerable('keydown', 'textarea[name=markdown]', { eventProperties: { keyCode: 13, ctrlKey: true } }),

    bodyPreview: {
      scope: '.body-preview'
    },

    clickPreview: clickable('.preview'),

    markdown: fillable('textarea[name=markdown]')
  },

  errors: collection('.error'),

  rendersLogin: isVisible('a[href$=login]'),
  rendersMarkdown: isVisible('[name=markdown]'),
  rendersSaveButton: isVisible('[name=save]'),
  rendersSignup: isVisible('a[href$=signup]')
github code-corps / code-corps-ember / tests / pages / onboarding.js View on Github external
visitable
} from 'ember-cli-page-object';
import imageDrop from 'code-corps-ember/tests/pages/components/image-drop';
import navMenu from './components/navigation-menu';
import skillsTypeahead from './components/skills-typeahead';

export default create({
  start: visitable('/start'),
  interests: visitable('/start/interests'),
  skills: visitable('/start/skills'),
  expertise: visitable('/start/expertise'),

  firstName: fillable('[name="firstName"]'),
  firstNameEnter: triggerable('keyup', '[name="firstName"]', { eventProperties: { keyCode: 13 } }),
  lastName: fillable('[name="lastName"]'),
  lastNameEnter: triggerable('keyup', '[name="lastName"]', { eventProperties: { keyCode: 13 } }),
  clickCategoryItem: clickable('.category-item button'),

  footer: {
    scope: '.site-footer'
  },

  startButton: {
    scope: '.hello__column--name-input button',
    isDisabled: attribute('disabled')
  },

  startFooterButton: {
    scope: '.start__footer button',
    isDisabled: attribute('disabled')
  },
github travis-ci / travis-web / tests / pages / sidebar.js View on Github external
export default create({
  visit: visitable('/'),
  repoTitle: text('.repo-header .repo-title h1'),
  clickSidebarMyReposTab: clickable('#tab_owned a'),
  clickSidebarRunningTab: clickable('#tab_running a'),
  runningTabIsActive: hasClass('active', '#tab_running'),
  myReposTabIsActive: hasClass('active', '#tab_owned'),
  navigateToProfilePage: clickable('#profile-page-link'),
  sidebarRepositories: collection('ul.repos-list li.repo', repositoryObject),
  sidebarRunningTabText: text('#tab_running a'),
  sidebarRunningRepositories: collection('.sidebar-list .tile--sidebar', repositoryObject),
  missingReposMessage: text('.loading-container'),
  viewRunningJob: clickable('p.tile-title a'),
  enterSearchQuery: fillable('#travis-search'),
  pressEnter: triggerable('keyup', '#travis-search', { eventProperties: { keyCode: 13 } }),
});
github code-corps / code-corps-ember / tests / pages / components / github / issue-link.js View on Github external
issueNumber: {
    scope: '[data-test-issue-number]'
  },

  isTooltipTarget: hasClass('ember-tooltip-or-popover-target'),

  loadingLarge: {
    scope: '[data-test-loading-large]'
  },

  loadingSmall: {
    scope: '[data-test-loading-small]'
  },

  mouseenter: triggerable('mouseenter'),
  mouseleave: triggerable('mouseleave'),

  repoName: {
    scope: '[data-test-repo-name]'
  },

  tooltip,

  url: {
    scope: '[data-test-issue-url]'
  }
};
github code-corps / code-corps-ember / tests / pages / components / signup-email-input.js View on Github external
import {
  fillable,
  triggerable
} from 'ember-cli-page-object';

import suggestionsArea from 'code-corps-ember/tests/pages/components/_suggestions-area';

export default {
  fillIn: fillable('input'),
  keydown: triggerable('keydown', 'input'),

  suggestionsArea
};
github ilios / frontend / tests / pages / components / global-search-box.js View on Github external
const definition = {
  scope: '[data-test-global-search-box]',
  input: fillable('input'),
  inputValue: value('input'),
  inputHasFocus: is(':focus', 'input'),
  triggerInput: triggerable('keyup', 'input'),
  clickIcon: clickable('[data-test-search-icon]'),
  autocompleteResults: collection('[data-test-autocomplete] li'),
  resultsRow1HasActiveClass: hasClass('active', 'li:nth-child(1)'),
  resultsRow2HasActiveClass: hasClass('active', 'li:nth-child(2)'),
  resultsRow3HasActiveClass: hasClass('active', 'li:nth-child(3)'),
  keyUp: {
    scope: '[data-test-input]',
    enter: triggerable('keyup', '', { eventProperties: { key: 'Enter' } }),
    down: triggerable('keyup', '', { eventProperties: { key: 'ArrowDown' } }),
    up: triggerable('keyup', '', { eventProperties: { key: 'ArrowUp' } }),
    escape: triggerable('keyup', '', { eventProperties: { key: 'Escape' } }),
  }
};

export default definition;
export const component = create(definition);
github code-corps / code-corps-ember / tests / pages / components / skills-typeahead-result.js View on Github external
import { collection, hasClass, triggerable } from 'ember-cli-page-object';

export default {
  scope: '.skill-dropdown-item',

  listItemIsSelected: hasClass('selected'),
  mouseenter: triggerable('mouseenter'),
  mousedown: triggerable('mousedown'),

  highlightedStrings: collection('strong')
};