Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {
clickable,
collection,
create,
hasClass,
isHidden
} from 'ember-cli-page-object';
const definition = {
prevIsHidden: isHidden('.prev-link'),
nextIsHidden: isHidden('.next-link'),
prevDisabled: hasClass('inactive', '.prev-link'),
nextDisabled: hasClass('inactive', '.next-link'),
clickPrev: clickable('.prev-link'),
clickNext: clickable('.next-link'),
clickLastPage: clickable('.page-button:last'),
pageLinks: collection('.page-button')
};
export default definition;
export const component = create(definition);
isPresent: isPresent(),
},
selectAll: {
scope: '[data-test-select-all]',
isPresent: isPresent(),
checked: hasClass('travis-form__field-checkbox--checked', 'travis-form__field-checkbox')
},
repoList: {
scope: '[data-test-repo-list]',
isPresent: isPresent(),
repos: collection('[data-test-repo]', {
checked: hasClass('travis-form__field-checkbox--checked', 'travis-form__field-checkbox'),
disabled: hasClass('travis-form__field-checkbox--disabled', 'travis-form__field-checkbox'),
})
},
migrateButton: {
scope: '[data-test-migrate-button]',
isPresent: isPresent(),
click: clickable()
}
}
}
});
clickEdit: clickable('button[name=edit]'),
clickSave: clickable('button[name=save]'),
edit: {
scope: 'button[name=edit]'
},
editorWithPreview,
fillInTextarea: fillable('textarea'),
longDescription: {
scope: '.long-description',
isEmpty: hasClass('empty'),
paragraph: {
scope: 'p',
text: text()
},
strong: {
scope: 'strong',
text: text()
},
list: {
scope: 'ul',
text: text(),
listItem: {
yamlTab: {
scope: '[data-test-build-yaml-tab]',
isDisabled: hasClass('disabled')
},
yamlMessagesHeader: {
scope: '.yml-messages .header'
},
ymlMessages: collection('.yml-message', {
icon: {
scope: '.level-icon svg',
isInfo: hasClass('icon-info'),
isWarning: hasClass('icon-warn'),
isError: hasClass('icon-error')
},
message: text('.message'),
link: {
scope: '[data-test-yml-message-link]',
isPresent: isPresent(),
href: attribute('href'),
text: text(),
}
}),
yaml: collection('.inner-yaml-container', {
codeblock: {
scope: '[data-test-yaml]',
text: text(),
id: attribute('id'),
},
get() {
return this.svg.use.xlinkHref.indexOf(ICONS.user) > -1;
}
},
svg: {
scope: 'svg',
hasClass,
isSolidBlack: hasClass('solid-black'),
isSolidBlue: hasClass('solid-blue'),
isSolidDarkBlue: hasClass('solid-dark-blue'),
isSolidGreen: hasClass('solid-green'),
isSolidLightGray: hasClass('solid-light-gray'),
isSolidPurple: hasClass('solid-purple'),
isSolidRed: hasClass('solid-red'),
isSolidWhite: hasClass('solid-white'),
use: {
scope: 'use',
xlinkHref: attribute('xlink:href')
}
}
};
hasClass,
triggerable
} from 'ember-cli-page-object';
export default {
scope: '.conversation-part',
body: {
scope: '[data-test-body]'
},
closedAt: {
scope: '[data-test-closed-at]'
},
isByCurrentUser: hasClass('conversation-part--is-self'),
isComment: hasClass('conversation-part--comment'),
isClosed: hasClass('conversation-part--closed'),
isReopened: hasClass('conversation-part--reopened'),
photo: {
scope: '[data-test-target-photo]',
url: attribute('src')
},
photoContainer: {
scope: '[data-test-target-photo-container]',
mouseenter: triggerable('mouseenter')
},
reopenedAt: {
scope: '[data-test-reopened-at]'
newCourseLinkIsHidden: isHidden('[data-test-new-course] a'),
savedCoursesCount: count('[data-test-courses] [data-test-active-row]'),
visitNewCourse: clickable('[data-test-new-course] a'),
courses: collection({
scope: '[data-test-ilios-course-list]',
itemScope: '[data-test-courses] [data-test-active-row]',
item: {
title: text('td', { at: 0 }),
school: text('td', { at: 1 }),
year: text('td', { at: 2 }),
level: text('td', { at: 3 }),
startDate: text('td', { at: 4 }),
endDate: text('td', { at: 5 }),
status: text('td', { at: 6 }),
isLocked: hasClass('fa-lock', 'svg', {scope: 'td:eq(6)', at: 0}),
isUnlocked: hasClass('fa-unlock', 'svg', {scope: 'td:eq(6)', at: 0}),
lock: clickable('.fa-unlock', {scope: 'td:eq(6)'}),
unLock: clickable('.fa-lock', {scope: 'td:eq(6)'}),
remove: clickable('.remove', {scope: 'td:eq(6)'}),
removeActionCount: count('.remove', {scope: 'td:eq(6)'}),
},
}),
emptyListRowIsVisible: isVisible('[data-test-empty-list]'),
sortByTitle: clickable('th', {scope: '[data-test-ilios-course-list] [data-test-course-headings]', at: 0}),
sortByLevel: clickable('th', {scope: '[data-test-ilios-course-list] [data-test-course-headings]', at: 3}),
sortByStartDate: clickable('th', {scope: '[data-test-ilios-course-list] [data-test-course-headings]', at: 4}),
sortByEndDate: clickable('th', {scope: '[data-test-ilios-course-list] [data-test-course-headings]', at: 5}),
sortByStatus: clickable('th', {scope: '[data-test-ilios-course-list] [data-test-course-headings]', at: 6}),
confirmCourseRemoval: clickable('[data-test-courses] .confirm-removal button.remove'),
});