confirmations: '[data-test-confirmations]', }; export const page = create({ textarea: { scope: '[data-test-chat-entry]', isDisabled: is('[disabled]'), fillIn: fillable(), }, submitButton: { scope: '[data-test-chat-submit]', isDisabled: is('[disabled]'), }, numberOfMessages: count('[data-test-chat-message]'), messages: collection('[data-test-chat-message]', { hasLoader: isVisible('.ellipsis-loader'), confirmations: { scope: '[data-test-confirmations]', text: text(), hoverTip: text('.hover-tip'), delete: clickable('[data-test-delete]'), resend: clickable('[data-test-resend]'), autosend: clickable('[data-test-autosend]'), }, }), }); export const chat = { selectors, textarea: { fillIn: (text: string) => fillIn('[data-test-chat-entry]', text),
import { click, find, fillIn } from '@ember/test-helpers'; import { create, collection, clickable, isVisible, fillable } from 'ember-cli-page-object'; const wrapper = '[data-test-settings-wrapper]'; export const page = create({ ui: { toggleHideOfflineContacts: clickable('[data-test-hide-offline-contacts]'), }, relays: { addRelay: clickable('[data-test-add-relay]'), form: { scope: '[data-test-add-relay-form]', isVisible: isVisible(), fillSocket: fillable('[data-test-socket-field]'), fillOg: fillable('[data-test-og-field]'), save: clickable('[data-test-save-relay]'), }, table: { rows: collection('[data-test-relays] tbody tr', { isConnected: isVisible('[data-test-connected]'), remove: clickable('[data-test-remove]'), makeDefault: clickable('[data-test-make-default]'), }), }, }, permissions: { notifications: { scope: '[data-test-notifications]', isVisible: isVisible(), },
toggleButton, sidebarContainer, channelForm, contacts, offlineCount, }; export const openSidebar = async () => { await page.toggle(); await waitUntilTruthy(() => page.isOpen); }; export const page = create({ scope: '[data-test-offcanvas-wrapper]', toggle: clickable(`${sidebarContainer} ${toggleButton}`), isPresent: isVisible('[data-test-sidebar-container]'), isOpen: isVisible('[data-test-sidebar-container].is-sidebar-visible'), contacts: { header: { scope: '[data-test-sidebar-contacts-header]', clickAdd: clickable('[data-test-add-friend]'), }, listText: text('[data-test-contact-row]'), list: collection('[data-test-sidebar-contacts-list] [data-test-contact-row]', { name: text('[data-test-contact-name]'), }), offlineCount: { scope: '[data-test-offline-count]', }, }, channels: {
import { find, click, waitFor } from '@ember/test-helpers'; import { create, isVisible, text, clickable } from 'ember-cli-page-object'; const toast = '[data-test-notification-message]'; export const selectors = { headerUnread: '[data-test-unread-count]', }; export const page = create({ toast: { scope: '[data-test-notification-message]', isVisible: isVisible(), text: text(), }, headerUnread: { scope: selectors.headerUnread, }, notificationPrompt: { scope: '[data-test-notification-prompt]', isVisible: isVisible(), askLater: clickable('[data-test-ask-later]'), askNever: clickable('[data-test-ask-never]'), enable: clickable('[data-test-enable]'), dismiss: clickable('[data-test-dismiss]'), }, modals: {}, }); export const app = { selectors: {