test('can alias through composition', async function(assert) {
   assert.expect(1);
 
   const aliasPage = create({
     isButtonVisible: isVisible('button'),
     aliasedIsButtonVisible: alias('isButtonVisible')
   });
 
 
   let page = create({
     scope: '.container',
     aliasPage: aliasPage
   });
   await this.adapter.createTemplate(this, page, '<div class="container"><button>Look at me</button></div>');
 
   assert.ok(page.aliasPage.aliasedIsButtonVisible);
 });
import { isVisible } from 'ember-cli-page-object';

import createAccount from './create-account';
import bankAccount from './bank-account';
import contactInfo from './contact-info';
import fundsRecipient from './funds-recipient';

export default {
  scope: '.account-setup',

  rendersBankAccount: isVisible('.bank-account'),
  rendersBankAccountRequired: isVisible('.bank-account.panel--highlighted'),
  rendersBankAccountVerified: isVisible('.bank-account.panel--highlighted-green'),

  rendersCreateAccount: isVisible('.create-account'),

  rendersFundsRecipient: isVisible('.funds-recipient'),
  rendersFundsRecipientRequired: isVisible('.funds-recipient.panel--highlighted'),
  rendersFundsRecipientVerified: isVisible('.funds-recipient.panel--highlighted-green'),
  rendersFundsRecipientVerifying: isVisible('.funds-recipient.panel'),

  createAccount,
  bankAccount,
  contactInfo,
  fundsRecipient
};
Example #3
0
  visitable,
  collection,
  text,
  isVisible,
  clickable
} from 'ember-cli-page-object';

const url = '/status';

export default create({
  visit: visitable(url),
  url,

  hub: {
    scope: 'hub-status',
    isVisible: isVisible(),
    notSetup: isVisible('p[data-test="not-setup"]'),

    addHub: {
      scope: 'div[data-test="add-hub"]',
      isVisible: isVisible(),
      click: clickable('button')
    },

    addTap: {
      scope: 'div[data-test="add-tap"]',
      isVisible: isVisible(),
      click: clickable('button')
    },

    addSensor: {
Example #4
0
  visitable,
  isVisible,
  text,
  clickable,
  collection
} from 'ember-cli-page-object';

const url = '/';

export default create({
  visit: visitable(url),
  url,

  toolbar: {
    scope: 'md-card-content md-toolbar',
    isVisible: isVisible(),
    text: text('h2'),
    menu: {
      scope: 'button',
      isVisible: isVisible(),
      click: clickable()
    }
  },

  navigation: collection({
    itemScope: 'md-sidenav md-content md-list > md-list-item',
    item: {
      text: text('span.link > a'),
      click: clickable()
    }
  }),
Example #5
0
  fillable,
  isVisible,
  text,
  clickOnText,
  clickable,
  hasClass,
  count
} from 'ember-cli-page-object';

const url = '/beer/add';

export default create({
  visit: visitable(url),
  url,

  noHub: isVisible('p[data-test="no-hub"]'),
  noTaps: isVisible('p[data-test="no-taps"]'),

  form: {
    scope: 'add-beer',
    isVisible: isVisible(),

    name: {
      scope: 'div[data-test="name"]',
      label: {
        scope: 'label',
        class: attribute('class'),
        text: text()
      },
      input: {
        scope: 'input[type="text"]',
import {
  clickable,
  collection,
  fillable,
  isVisible
} from 'ember-cli-page-object';

export default {
  scope: '.comment-item',

  clickEdit: clickable('.edit'),
  clickSave: clickable('.save'),
  clickCancel: clickable('.cancel'),

  codeThemeSelectorVisible: isVisible('.code-theme-selector'),

  commentBody: {
    scope: '.comment-body'
  },
  nullCommentBody:{
    scope: '[data-test-markdown-body-empty]'
  },
  editLink: {
    scope: '.edit'
  },

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

    bodyPreview: {
      scope: '.body-preview p'
import {
  attribute,
  collection,
  isVisible
} from 'ember-cli-page-object';

export default {
  scope: '.project-list',

  isVisible: isVisible(),

  items: collection({
    itemScope: '.project-item',
    item: {
      href: attribute('href', 'a:eq(0)')
    }
  })
};
import {
  clickable,
  isVisible,
  text
} from 'ember-cli-page-object';

export default {
  scope: '.error-wrapper',

  body: text('p:first'),

  button: {
    scope: 'a.button',
    text: text()
  },

  clickLink: clickable('a'),

  has404Image: isVisible('.not-found-img'),
  hasMaintenanceIcon: isVisible('.maintenance-icon'),
  hasServerErrorImage: isVisible('.server-error-img'),

  title: text('h1')
};
import codeThemeSelector from 'code-corps-ember/tests/pages/components/code-theme-selector';
import submittableTextarea from 'code-corps-ember/tests/pages/components/submittable-textarea';

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

  bodyPreview: {
    scope: '.body-preview',
    text: text()
  },

  clickEdit: clickable('.edit'),
  clickPreview: clickable('.preview'),

  codeThemeSelector,

  editButton: {
    scope: 'button.edit',
    isActive: hasClass('active')
  },

  textarea: submittableTextarea,

  isEditing: hasClass('editing'),
  isPreviewing: hasClass('previewing'),

  spinnerIsVisible: isVisible('.spinner'),

  style: attribute('style')
};
Example #10
0
    failed: hasClass('failed'),
    errored: hasClass('errored'),

    commitSha: text('.row-commit .label-align'),
    committer: text('.row-committer .label-align'),

    commitDate: {
      scope: '.row-calendar div',
      title: attribute('title'),
      text: text('.label-align')
    },

    requestIconTitle: attribute('title', '.row-item.request span[title]'),
    duration: text('.row-duration .label-align'),
    message: text('.row-message'),

    cancelButton: {
      scope: '.action-button--cancel',
      visible: isVisible(),
      click: clickable()
    }
  }),

  showMoreButton: {
    scope: 'button.showmore-button',

    exists: isVisible(),
    click: clickable()
  }
});
import { collection, isVisible } from 'ember-cli-page-object';
import projectSkillItem from 'code-corps-ember/tests/pages/components/project-skill-item';

export default {
  scope: '.project-skills-list',

  header: {
    scope: '.project-skills-list__header'
  },

  headerIsVisible: isVisible('.project-skills-list__header'),

  fallback: {
    scope: '.project-skills-list__falback'
  },

  fallbackIsVisible: isVisible('.project-skills-list__fallback'),

  skills: collection({
    itemScope: '.skill',
    item: projectSkillItem
  })
};
Example #12
0
export default create({
  visit: visitable('/:username/?tab=insights'),

  privacySelector: {
    scope: '[data-test-insights-privacy-selector]',
    selected: text('[data-test-insights-privacy-selector-selected]'),
    mainField: text('[data-test-insights-privacy-selector-main-field]'),
  },

  glances: collection('[data-test-insights-glance]', {
    name: text('[data-test-insights-glance-title]'),
    keyStat: text('[data-test-insights-glance-stat]'),
    percentChange: text('[data-test-insights-glance-delta-stat]'),

    chartIsVisible: isVisible('[data-test-insights-glance-chart]'),
    chartPlaceholderIsVisible: isVisible('[data-test-insights-glance-chart-placeholder]'),
  }),

  odysseys: collection('[data-test-insights-odyssey]', {
    name: text('[data-test-insights-odyssey-title]'),
    chart: text('[data-test-insights-odyssey-chart]'),
  }),

  noBuildOverlay: {
    scope: '[data-test-insights-overlay]',
    title: text('[data-test-insights-overlay-title]'),
    text: text('[data-test-insights-overlay-text]'),
    link: text('[data-test-insights-overlay-link]'),
  }
});
Example #13
0
import {
  create,
  collection,
  clickable,
  fillable,
  text,
  isVisible,
  visitable,
} from 'ember-cli-page-object';

export default create({
  visit: visitable('/settings/tokens'),

  secret: fillable('[data-test-token-secret]'),
  submit: clickable('[data-test-token-submit]'),

  errorMessage: isVisible('[data-test-token-error]'),
  successMessage: isVisible('[data-test-token-success]'),
  managementMessage: isVisible('[data-test-token-management-message]'),

  policies: collection('[data-test-token-policy]', {
    name: text('[data-test-policy-name]'),
    description: text('[data-test-policy-description]'),
    rules: text('[data-test-policy-rules]', { normalize: false }),
  }),
});
Example #14
0
import {
  create,
  clickable,
  collection,
  hasClass,
  isVisible,
  text,
  visitable
} from 'ember-cli-page-object';

const cacheComponent = {
  name: text('.row-branch .label-align'),
  lastModified: text('.row-calendar .label-align'),
  size: text('.row-size .label-align'),

  delete: clickable('.delete-cache-icon')
};

export default create({
  visit: visitable(':organization/:repo/caches'),

  tabIsActive: hasClass('active', '#tab_caches'),

  deleteAllCaches: clickable('.delete-cache-button'),
  noCachesExist: isVisible('p.helptext.no-caches'),

  pushCaches: collection('.push-caches .cache-item', cacheComponent),
  pullRequestCaches: collection('.pull-request-caches .cache-item', cacheComponent)
});
          nativeMouseUp(domElement);
          return this;
        }
      }
    })
  },

  trigger: {
    scope: '.ember-power-select-trigger',
    assigned: {
      isDescriptor: true,
      get() {
        return !this.unassigned;
      }
    },
    close: clickTrigger,
    open: clickTrigger,
    unassigned: {
      isDescriptor: true,
      get() {
        return this.unselectedIcon.isVisible;
      }
    },
    unselectedIcon: {
      scope: '[data-test-unselected-icon]'
    }
  },

  triggerRenders: isVisible('.ember-power-select-trigger')
};
Example #16
0
  repoTitle: text('.repo-title'),
  accountFilter: clickable('.dashboard-header .organisation-filter .option-list a:first-of-type'),
  syncButton: clickable('.dashboard-header .sync-button button'),
  syncButtonIsSyncing: hasClass('is-syncing', '.dashboard-header .sync-button button'),

  activeRepos: {
    visit: clickable('[data-test-active-repos-tab]'),

    repos: collection('.dashboard-active .repo-list li.rows--dashboard', {
      owner: text('.dash-header .row-label a'),
      repoName: text('.dash-header .row-content a'),
      defaultBranch: text('.dash-default .row-content a'),
      lastBuild: text('.dash-last a .label-align'),
      triggerBuild: clickable('.dash-menu .dropup-list li:first-of-type a'),
      clickStarButton: clickable('.dash-head .dash-star'),
      hasTofuButton: isVisible('.dash-menu .dropup')
    })
  },

  starredRepos: collection('.dashboard-starred .repo-list li.rows--dashboard', {
    owner: text('.dash-header .row-label a'),
    repoName: text('.dash-header .row-content a'),
    defaultBranch: text('.dash-default .row-content a'),
    lastBuild: text('.dash-last a .label-align'),
    triggerBuild: clickable('.dash-menu .dropup-list li:first-of-type a'),
    clickUnStarButton: clickable('.dash-head .dash-star'),
    hasTofuButton: isVisible('.dash-menu .dropup')
  }),
  paginationIsVisible: isVisible('.pagination-navigation'),
  paginationLinks: collection('.pagination-navigation li', {
    label: text('a'),
Example #17
0
import {
  create,
  clickable,
  isVisible,
  text,
  visitable
} from 'ember-cli-page-object';

export default create({
  visit: visitable(':organization/:repo'),
  notActiveHeadline: text('.missing-notice .page-title'),
  notActiveNotice: text('.missing-notice .page-notice'),
  activateButton: isVisible('.missing-notice button'),
  activate: clickable('.missing-notice button'),
  githubAppsActivateButton: isVisible('.missing-notice a.button')
});
import { clickable, isVisible } from 'ember-cli-page-object';
import showDonationComponent from './show-donation';

export default {
  scope: '.donation-status',

  clickLink: clickable('a'),

  rendersLink: isVisible('a'),
  rendersShowDonation: isVisible('.show-donation'),

  showDonation: showDonationComponent
};
Example #19
0
import {
  create,
  attribute,
  visitable,
  clickable,
  collection,
  isHidden,
  isVisible,
  selectable,
  fillable
} from 'ember-cli-page-object';

export default create({
  visit: visitable(':owner/:repo'),
  popupIsHidden: isHidden('.trigger-build-modal'),
  popupTriggerLinkIsHidden: isHidden('.option-dropdown .trigger-build-anchor'),
  openPopup: clickable('.option-dropdown .trigger-build-anchor'),
  popupIsVisible: isVisible('.trigger-build-modal'),

  selectBranch: selectable('#trigger-build-branches'),
  branches: collection('#trigger-build-branches option', {
    value: attribute('value')
  }),

  writeMessage: fillable('#trigger-build-message'),
  writeConfig: fillable('#trigger-build-config'),
  clickSubmit: clickable('.trigger-build-submit')
});
Example #20
0
import {
  isVisible,
  attribute,
  collection,
  create,
  clickable,
  triggerable,
  text
} from 'ember-cli-page-object';

export default create({

  month: text('.en-daypicker-meta-month'),
  year:  text('.en-daypicker-meta-year option:selected'),

  hasToday: isVisible('.is-today'),
  today:    text('.is-today'),

  selectedDay: text('.en-daypicker-day.is-selected'),

  days: collection({
    itemScope: '.en-daypicker-day:not(.is-disabled)',

    item: {
      daypickerDay: attribute('data-daypicker-day'),
      click: clickable(),
      down:  triggerable('keydown', '', { eventProperties: { keyCode: 40 } }),
      up:    triggerable('keydown', '', { eventProperties: { keyCode: 38 } }),
      prev:  triggerable('keydown', '', { eventProperties: { keyCode: 37 } }),
      next:  triggerable('keydown', '', { eventProperties: { keyCode: 39 } }),
      enter: triggerable('keydown', '', { eventProperties: { keyCode: 13 } }),
} 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({
    itemScope: '.error'
  }),

  rendersLogin: isVisible('a[href$=login]'),
  rendersMarkdown: isVisible('[name=markdown]'),
  rendersSaveButton: isVisible('[name=save]'),
  rendersSignup: isVisible('a[href$=signup]')
};
Example #22
0
      label: text(".label")
    }
  }),

  openQuickMenu: clickable(".debug_navs_orders-nav .debug_ui_popup-menu .trigger"),

  stubOrders: clickable(".stubOrders"),
  createOrder: clickable(".createOrder"),

  // createOrder(){
  //   $(".createOrder").click();
  // },

  selectLocation(location) {
    return selectChoose(".locationContainer", location.get("label"));
  },

  toggleFilterOptions: clickable(".titleBar .action"),
  toggleIncludeDraft: clickable(".includeUnpublished input"),
  toggleIncludePublished: clickable(".includePublished input"),
  inputFilterQuery: value(".filterQuery input"),
  selectFilterItem(item) {
    return selectChoose(".itemFilterContainer", item.get("name"));
  },

  bannerIsVisible: isVisible(".debug_ui_alert-banner")
});


export { page };
Example #23
0
   itemScope: '[data-test-year-filter] option',
   item: {
     text: text(),
     selected: property('selected'),
   },
 }),
 schoolFilters: collection({
   itemScope: '[data-test-school-filter] option',
   item: {
     text: text(),
     selected: property('selected'),
   },
 }),
 headerTitle: text('[data-test-courses-header-title]'),
 toggleNewCourseForm: clickable('[data-test-toggle-new-course-form] button'),
 toggleNewCourseFormExists: isVisible('[data-test-toggle-new-course-form]'),
 newCourseForm: {
   scope: '[data-test-new-course]',
   title: fillable('[data-test-title]'),
   chooseYear: fillable('[data-test-year]'),
   save: clickable('.done'),
   years: collection({
     itemScope: '[data-test-year] option',
     item: {
       text: text(),
       selected: property('selected'),
     },
   }),
 },
 newCourseLink: text('[data-test-new-course] a'),
 savedCoursesCount: count('[data-test-new-course] a'),