Best JavaScript code snippet using playwright-internal
09-roomactions.spec.js
Source:09-roomactions.spec.js
...10 room = 'rocket.cat';11 } else {12 room = `private${ data.random }`;13 }14 await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);15 await element(by.type('UIScrollView')).atIndex(1).scrollTo('top');16 await element(by.id('rooms-list-view-search')).typeText(room);17 await sleep(2000);18 await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);19 await element(by.id(`rooms-list-view-item-${ room }`)).tap();20 await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(2000);21 await sleep(1000);22 await element(by.id('room-view-header-actions')).tap();23 await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000);24}25async function backToActions() {26 await tapBack();27 await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);28 await expect(element(by.id('room-actions-view'))).toBeVisible();29}30async function backToRoomsList() {31 await tapBack();32 await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(2000);33 await tapBack();34 await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000);35}36describe('Room actions screen', () => {37 describe('Render', async() => {38 describe('Direct', async() => {39 before(async() => {40 await navigateToRoomActions('d');41 });42 it('should have room actions screen', async() => {43 await expect(element(by.id('room-actions-view'))).toBeVisible();44 });45 46 it('should have info', async() => {47 await expect(element(by.id('room-actions-info'))).toBeVisible();48 });49 50 // it('should have voice', async() => {51 // await expect(element(by.id('room-actions-voice'))).toBeVisible();52 // });53 54 // it('should have video', async() => {55 // await expect(element(by.id('room-actions-video'))).toBeVisible();56 // });57 58 it('should have files', async() => {59 await expect(element(by.id('room-actions-files'))).toBeVisible();60 });61 62 it('should have mentions', async() => {63 await expect(element(by.id('room-actions-mentioned'))).toBeVisible();64 });65 66 it('should have starred', async() => {67 await expect(element(by.id('room-actions-starred'))).toBeVisible();68 });69 70 it('should have search', async() => {71 await expect(element(by.id('room-actions-search'))).toBeVisible();72 });73 74 it('should have share', async() => {75 await waitFor(element(by.id('room-actions-share'))).toBeVisible();76 await expect(element(by.id('room-actions-share'))).toBeVisible();77 });78 79 it('should have pinned', async() => {80 await waitFor(element(by.id('room-actions-pinned'))).toBeVisible();81 await expect(element(by.id('room-actions-pinned'))).toBeVisible();82 });83 84 it('should have notifications', async() => {85 await waitFor(element(by.id('room-actions-notifications'))).toBeVisible();86 await expect(element(by.id('room-actions-notifications'))).toBeVisible();87 });88 it('should have block user', async() => {89 await waitFor(element(by.id('room-actions-block-user'))).toBeVisible();90 await expect(element(by.id('room-actions-block-user'))).toBeVisible();91 });92 after(async() => {93 await backToRoomsList();94 });95 });96 describe('Channel/Group', async() => {97 before(async() => {98 await navigateToRoomActions('c');99 });100 it('should have room actions screen', async() => {101 await expect(element(by.id('room-actions-view'))).toBeVisible();102 });103 104 it('should have info', async() => {105 await expect(element(by.id('room-actions-info'))).toBeVisible();106 });107 108 // it('should have voice', async() => {109 // await expect(element(by.id('room-actions-voice'))).toBeVisible();110 // });111 112 // it('should have video', async() => {113 // await expect(element(by.id('room-actions-video'))).toBeVisible();114 // });115 it('should have members', async() => {116 await expect(element(by.id('room-actions-members'))).toBeVisible();117 });118 it('should have add user', async() => {119 await expect(element(by.id('room-actions-add-user'))).toBeVisible();120 });121 122 it('should have files', async() => {123 await expect(element(by.id('room-actions-files'))).toBeVisible();124 });125 126 it('should have mentions', async() => {127 await expect(element(by.id('room-actions-mentioned'))).toBeVisible();128 });129 130 it('should have starred', async() => {131 await expect(element(by.id('room-actions-starred'))).toBeVisible();132 });133 134 it('should have search', async() => {135 await expect(element(by.id('room-actions-search'))).toBeVisible();136 });137 138 it('should have share', async() => {139 await waitFor(element(by.id('room-actions-share'))).toBeVisible();140 await expect(element(by.id('room-actions-share'))).toBeVisible();141 });142 143 it('should have pinned', async() => {144 await waitFor(element(by.id('room-actions-pinned'))).toBeVisible();145 await expect(element(by.id('room-actions-pinned'))).toBeVisible();146 });147 148 it('should have notifications', async() => {149 await waitFor(element(by.id('room-actions-notifications'))).toBeVisible();150 await expect(element(by.id('room-actions-notifications'))).toBeVisible();151 });152 153 it('should have leave channel', async() => {154 await waitFor(element(by.id('room-actions-leave-channel'))).toBeVisible();155 await expect(element(by.id('room-actions-leave-channel'))).toBeVisible();156 });157 });158 });159 describe('Usage', async() => {160 describe('TDB', async() => {161 // TODO: test into a jitsi call162 // it('should NOT navigate to voice call', async() => {163 // await waitFor(element(by.id('room-actions-voice'))).toBeVisible();164 // await element(by.id('room-actions-voice')).tap();165 // await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);166 // await expect(element(by.id('room-actions-view'))).toBeVisible();167 // });168 // TODO: test into a jitsi call169 // it('should NOT navigate to video call', async() => {170 // await element(by.id('room-actions-video')).tap();171 // await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);172 // await expect(element(by.id('room-actions-view'))).toBeVisible();173 // });174 // TODO: test share room link175 // it('should NOT navigate to share room', async() => {176 // await waitFor(element(by.id('room-actions-share'))).toBeVisible();177 // await element(by.id('room-actions-share')).tap();178 // await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);179 // await expect(element(by.id('room-actions-view'))).toBeVisible();180 // });181 });182 describe('Common', async() => {183 it('should show mentioned messages', async() => {184 await element(by.id('room-actions-mentioned')).tap();185 await waitFor(element(by.id('mentioned-messages-view'))).toExist().withTimeout(2000);186 await expect(element(by.id('mentioned-messages-view'))).toExist();187 // await waitFor(element(by.text(` ${ data.random }mention`))).toBeVisible().withTimeout(60000);188 // await expect(element(by.text(` ${ data.random }mention`))).toBeVisible();189 await backToActions();190 });191 it('should show starred message and unstar it', async() => {192 await element(by.id('room-actions-starred')).tap();193 await waitFor(element(by.id('starred-messages-view'))).toExist().withTimeout(2000);194 await sleep(1000);195 await waitFor(element(by.label(`${ data.random }message`)).atIndex(0)).toBeVisible().withTimeout(60000);196 await expect(element(by.label(`${ data.random }message`)).atIndex(0)).toBeVisible();197 await element(by.label(`${ data.random }message`)).atIndex(0).longPress();198 await waitFor(element(by.text('Unstar'))).toBeVisible().withTimeout(2000);199 await expect(element(by.text('Unstar'))).toBeVisible();200 await element(by.text('Unstar')).tap();201 await waitFor(element(by.label(`${ data.random }message`))).toBeNotVisible().withTimeout(60000);202 await expect(element(by.label(`${ data.random }message`))).toBeNotVisible();203 await backToActions();204 });205 it('should show pinned message and unpin it', async() => {206 await waitFor(element(by.id('room-actions-pinned'))).toBeVisible();207 await element(by.id('room-actions-pinned')).tap();208 await waitFor(element(by.id('pinned-messages-view'))).toExist().withTimeout(2000);209 await sleep(1000);210 await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toBeVisible().withTimeout(60000);211 await expect(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toBeVisible();212 await element(by.label(`${ data.random }edited (edited)`)).atIndex(0).longPress();213 await waitFor(element(by.text('Unpin'))).toBeVisible().withTimeout(2000);214 await expect(element(by.text('Unpin'))).toBeVisible();215 await element(by.text('Unpin')).tap();216 await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toBeNotVisible().withTimeout(60000);217 await expect(element(by.label(`${ data.random }edited (edited)`))).toBeNotVisible();218 await backToActions();219 });220 it('should search and find a message', async() => {221 await element(by.id('room-actions-search')).tap();222 await waitFor(element(by.id('search-messages-view'))).toExist().withTimeout(2000);223 await expect(element(by.id('search-message-view-input'))).toBeVisible();224 await element(by.id('search-message-view-input')).replaceText(`/${ data.random }message/`);225 await waitFor(element(by.label(`${ data.random }message`)).atIndex(0)).toBeVisible().withTimeout(60000);226 await expect(element(by.label(`${ data.random }message`)).atIndex(0)).toBeVisible();227 await backToActions();228 });229 });230 describe('Notification', async() => {231 it('should navigate to notification preference view', async() => {232 await waitFor(element(by.id('room-actions-notifications'))).toBeVisible();233 await expect(element(by.id('room-actions-notifications'))).toBeVisible();234 await element(by.id('room-actions-notifications')).tap();235 await waitFor(element(by.id('notification-preference-view'))).toBeVisible().withTimeout(2000);236 await expect(element(by.id('notification-preference-view'))).toBeVisible();237 });238 it('should have receive notification option', async() => {239 await expect(element(by.id('notification-preference-view-receive-notification'))).toBeVisible();240 });241 it('should have show unread count option', async() => {242 await expect(element(by.id('notification-preference-view-unread-count'))).toBeVisible();243 });244 it('should have notification alert option', async() => {245 await expect(element(by.id('notification-preference-view-alert'))).toBeVisible();246 });247 it('should have push notification option', async() => {248 await waitFor(element(by.id('notification-preference-view-push-notification'))).toBeVisible();249 await expect(element(by.id('notification-preference-view-push-notification'))).toBeVisible();250 });251 it('should have notification audio option', async() => {252 await waitFor(element(by.id('notification-preference-view-audio'))).toBeVisible();253 await expect(element(by.id('notification-preference-view-audio'))).toBeVisible();254 });255 it('should have notification sound option', async() => {256 // Ugly hack to scroll on detox257 await element(by.type('UIScrollView')).atIndex(1).scrollTo('bottom');258 await waitFor(element(by.id('notification-preference-view-sound'))).toBeVisible();259 await expect(element(by.id('notification-preference-view-sound'))).toBeVisible();260 });261 it('should have notification duration option', async() => {262 await waitFor(element(by.id('notification-preference-view-notification-duration'))).toBeVisible();263 await expect(element(by.id('notification-preference-view-notification-duration'))).toBeVisible();264 });265 it('should have email alert option', async() => {266 await waitFor(element(by.id('notification-preference-view-email-alert'))).toBeVisible();267 await expect(element(by.id('notification-preference-view-email-alert'))).toBeVisible();268 });269 after(async() => {270 await backToActions();271 });272 })273 describe('Channel/Group', async() => {274 // Currently, there's no way to add more owners to the room275 // So we test only for the 'You are the last owner...' message276 it('should tap on leave channel and raise alert', async() => {277 await waitFor(element(by.id('room-actions-leave-channel'))).toBeVisible();278 await expect(element(by.id('room-actions-leave-channel'))).toBeVisible();279 await element(by.id('room-actions-leave-channel')).tap();280 await waitFor(element(by.text('Yes, leave it!'))).toBeVisible().withTimeout(2000);281 await expect(element(by.text('Yes, leave it!'))).toBeVisible();282 await element(by.text('Yes, leave it!')).tap();283 await waitFor(element(by.text('You are the last owner. Please set new owner before leaving the room.'))).toBeVisible().withTimeout(60000);284 await expect(element(by.text('You are the last owner. Please set new owner before leaving the room.'))).toBeVisible();285 await element(by.text('OK')).tap();286 await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);287 });288 it('should add user to the room', async() => {289 await waitFor(element(by.id('room-actions-add-user'))).toBeVisible();290 await element(by.id('room-actions-add-user')).tap();291 await element(by.id('select-users-view-search')).tap();292 await element(by.id('select-users-view-search')).replaceText(data.alternateUser);293 await waitFor(element(by.id(`select-users-view-item-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);294 await expect(element(by.id(`select-users-view-item-${ data.alternateUser }`))).toBeVisible();295 await element(by.id(`select-users-view-item-${ data.alternateUser }`)).tap();296 await waitFor(element(by.id(`selected-user-${ data.alternateUser }`))).toBeVisible().withTimeout(5000);297 await expect(element(by.id(`selected-user-${ data.alternateUser }`))).toBeVisible();298 await element(by.id('selected-users-view-submit')).tap();299 await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(2000);300 await element(by.id('room-actions-members')).tap();301 await element(by.id('room-members-view-toggle-status')).tap();302 await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);303 await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible();304 await backToActions(1);305 });306 describe('Room Members', async() => {307 before(async() => {308 await element(by.id('room-actions-members')).tap();309 await waitFor(element(by.id('room-members-view'))).toExist().withTimeout(2000);310 await expect(element(by.id('room-members-view'))).toExist();311 });312 it('should show all users', async() => {313 await sleep(1000);314 await element(by.id('room-members-view-toggle-status')).tap();315 await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);316 await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible();317 });318 it('should filter user', async() => {319 await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);320 await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible();321 await element(by.id('room-members-view-search')).replaceText('rocket');322 await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeNotVisible().withTimeout(60000);323 await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeNotVisible();324 await element(by.id('room-members-view-search')).tap();325 await element(by.id('room-members-view-search')).clearText('');326 await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);327 await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeVisible();328 });329 // FIXME: mute/unmute isn't working330 // it('should mute user', async() => {331 // await sleep(1000);332 // await element(by.id(`room-members-view-item-${ data.alternateUser }`)).longPress(1500);333 // await waitFor(element(by.text('Mute'))).toBeVisible().withTimeout(5000);334 // await expect(element(by.text('Mute'))).toBeVisible();335 // await element(by.text('Mute')).tap();336 // await waitFor(element(by.id('toast'))).toBeVisible().withTimeout(10000);337 // await expect(element(by.id('toast'))).toBeVisible();338 // await waitFor(element(by.id('toast'))).toBeNotVisible().withTimeout(10000);339 // await expect(element(by.id('toast'))).toBeNotVisible();340 // await element(by.id(`room-members-view-item-${ data.alternateUser }`)).longPress(1500);341 // await waitFor(element(by.text('Unmute'))).toBeVisible().withTimeout(2000);342 // await expect(element(by.text('Unmute'))).toBeVisible();343 // await element(by.text('Unmute')).tap();344 // await waitFor(element(by.id('toast'))).toBeVisible().withTimeout(10000);345 // await expect(element(by.id('toast'))).toBeVisible();346 // await waitFor(element(by.id('toast'))).toBeNotVisible().withTimeout(10000);347 // await expect(element(by.id('toast'))).toBeNotVisible();348 // });349 it('should navigate to direct room', async() => {350 await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist().withTimeout(5000);351 await element(by.id(`room-members-view-item-${ data.alternateUser }`)).tap();352 await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(60000);353 await expect(element(by.id('room-view'))).toBeVisible();354 await waitFor(element(by.id(`room-view-title-${ data.alternateUser }`))).toBeVisible().withTimeout(60000);355 await expect(element(by.id(`room-view-title-${ data.alternateUser }`))).toBeVisible();356 await tapBack();357 await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(2000);358 });359 });360 })361 describe('Direct', async() => {362 before(async() => {363 await navigateToRoomActions('d');364 });365 it('should block/unblock user', async() => {366 await waitFor(element(by.id('room-actions-block-user'))).toBeVisible();367 await sleep(1000);368 await element(by.id('room-actions-block-user')).tap();369 await waitFor(element(by.label('Unblock user'))).toBeVisible().withTimeout(60000);370 await expect(element(by.label('Unblock user'))).toBeVisible();371 await element(by.id('room-actions-block-user')).tap();372 await waitFor(element(by.label('Block user'))).toBeVisible().withTimeout(60000);373 await expect(element(by.label('Block user'))).toBeVisible();374 });375 });376 });...
playlist.e2e.js
Source:playlist.e2e.js
...10 // await element(by.text('Playlists')).tap();11 });12 // TC0313 it('should show playlists screen after tap', async () => {14 await expect(element(by.id('playlistsScreen'))).toBeVisible();15 });16 // TC0417 it('should show playlists screen after tap', async () => {18 // await expect(element(by.text('Playlists'))).toBeVisible();19 await expect(element(by.text('Create new playlist'))).toBeVisible();20 });21 // TC0522 it('should show song of playlist', async () => {23 await expect(element(by.id('listItem0'))).toBeVisible();24 await element(by.id('listItem0')).tap();25 await expect(element(by.id('showPlaylistScreen'))).toBeVisible();26 27 await device.pressBack();28 });29 // TC0630 it('should show song of playlist', async () => {31 await expect(element(by.id('listItem0'))).toBeVisible();32 await element(by.id('listItem0')).multiTap(2);33 await expect(element(by.id('showPlaylistScreen'))).toBeVisible();34 await device.pressBack();35 });36 // TC0737 it('should show playlists options', async () => {38 // await expect(element(by.text('Playlists'))).toBeVisible();39 await expect(element(by.id('showOptionButton0'))).toBeVisible();40 await element(by.id('showOptionButton0')).tap();41 await expect(element(by.text('Rename'))).toBeVisible();42 await expect(element(by.text('Delete'))).toBeVisible();43 await device.pressBack();44 });45 // TC0846 it('should show playlists options', async () => {47 // await expect(element(by.text('Playlists'))).toBeVisible();48 await expect(element(by.id('showOptionButton0'))).toBeVisible();49 await element(by.id('showOptionButton0')).multiTap(2);50 await expect(element(by.text('Rename'))).toBeVisible();51 await expect(element(by.text('Delete'))).toBeVisible();52 await device.pressBack();53 });54 // Check create playlist //55 // TC35 Create playlist56 it('should show create playlist popup', async () => {57 // await expect(element(by.text('Playlists'))).toBeVisible();58 await element(by.text('Create new playlist')).tap();59 await expect(element(by.text('Create playlist'))).toBeVisible();60 await element(by.id('cancelButton')).tap();61 });62 // TC36 Create playlist63 it('should show create playlist popup action', async () => {64 // await expect(element(by.text('Playlists'))).toBeVisible();65 await element(by.text('Create new playlist')).tap();66 await expect(element(by.text('Create playlist'))).toBeVisible();67 await expect(element(by.id('cancelButton'))).toBeVisible();68 await expect(element(by.id('saveButton'))).toBeVisible();69 await element(by.id('cancelButton')).tap();70 });71 // TC37 Create demo playlist72 it('should show create playlist ', async () => {73 await element(by.text('Create new playlist')).tap();74 await element(by.id('dialogInput')).replaceText('test playlist');75 await expect(element(by.id('saveButton'))).toBeVisible();76 await element(by.id('saveButton')).tap();77 await expect(element(by.text('test playlist'))).toBeVisible();78 });79 // TC38 should show create playlist number name80 it('should show create playlist number name', async () => {81 await element(by.text('Create new playlist')).tap();82 await element(by.id('dialogInput')).replaceText('123');83 await expect(element(by.id('saveButton'))).toBeVisible();84 await element(by.id('saveButton')).tap();85 await expect(element(by.text('123'))).toBeVisible();86 });87 // TC3988 it('should show create playlist special name', async () => {89 await element(by.text('Create new playlist')).tap();90 await element(by.id('dialogInput')).replaceText('!!!');91 await expect(element(by.id('saveButton'))).toBeVisible();92 await element(by.id('saveButton')).tap();93 await expect(element(by.text('!!!'))).toBeVisible();94 });95 // TC4096 it('should show create playlist vietnamese name', async () => {97 await element(by.text('Create new playlist')).tap();98 await element(by.id('dialogInput')).replaceText('Hay Nhất');99 await expect(element(by.id('saveButton'))).toBeVisible();100 await element(by.id('saveButton')).tap();101 await expect(element(by.text('Hay Nhất'))).toBeVisible();102 });103 // TC41104 it('should show create playlist lowercase name', async () => {105 await element(by.text('Create new playlist')).tap();106 await element(by.id('dialogInput')).replaceText('nhạc hay');107 await expect(element(by.id('saveButton'))).toBeVisible();108 await element(by.id('saveButton')).tap();109 await expect(element(by.text('nhạc hay'))).toBeVisible();110 });111 // TC42112 it('should show create playlist uppercase name', async () => {113 await element(by.text('Create new playlist')).tap();114 await element(by.id('dialogInput')).replaceText('NHẠC HAY NHẤT');115 await expect(element(by.id('saveButton'))).toBeVisible();116 await element(by.id('saveButton')).tap();117 await expect(element(by.text('NHẠC HAY NHẤT'))).toBeVisible();118 });119 // TC43120 it('should not able create playlist with empty name', async () => {121 await element(by.text('Create new playlist')).tap();122 await expect(element(by.id('saveButton'))).toBeVisible();123 await element(by.id('saveButton')).tap();124 await expect(element(by.id('saveButton'))).toBeVisible();125 await expect(element(by.id('cancelButton'))).toBeVisible();126 await element(by.id('cancelButton')).tap();127 });128 // TC44129 it('should not able create playlist with space name', async () => {130 await element(by.text('Create new playlist')).tap();131 await element(by.id('dialogInput')).replaceText(' ');132 await expect(element(by.id('saveButton'))).toBeVisible();133 await element(by.id('saveButton')).tap();134 await expect(element(by.id('saveButton'))).toBeVisible();135 await expect(element(by.id('cancelButton'))).toBeVisible();136 await element(by.id('cancelButton')).tap();137 });138 // TC45139 it('should not able create playlist with exist name', async () => {140 await element(by.text('Create new playlist')).tap();141 await element(by.id('dialogInput')).replaceText('Hay Nhất');142 await expect(element(by.id('saveButton'))).toBeVisible();143 await element(by.id('saveButton')).tap();144 await expect(element(by.id('saveButton'))).toBeVisible();145 await expect(element(by.id('cancelButton'))).toBeVisible();146 await element(by.id('cancelButton')).tap();147 });148 // Check rename playlist //149 // TC18, TC19, TC33, TC34150 it('should show rename options', async () => {151 await expect(element(by.id('showOptionButton0'))).toBeVisible();152 await element(by.id('showOptionButton0')).tap();153 await expect(element(by.text('Rename'))).toBeVisible();154 await element(by.text('Rename')).tap();155 await expect(element(by.text('CANCEL'))).toBeVisible();156 await expect(element(by.text('RENAME'))).toBeVisible();157 await element(by.text('CANCEL')).tap();158 await expect(element(by.text('RENAME'))).not.toBeVisible();159 await element(by.text('Rename')).tap();160 await element(by.text('CANCEL')).multiTap(2);161 await expect(element(by.text('RENAME'))).not.toBeVisible();162 await device.pressBack();163 });164 // TC31165 it('should able to rename playlist', async () => {166 await expect(element(by.id('showOptionButton0'))).toBeVisible();167 await element(by.id('showOptionButton0')).tap();168 await expect(element(by.text('Rename'))).toBeVisible();169 await element(by.text('Rename')).tap();170 await expect(element(by.id('dialogInput'))).toBeVisible();171 await element(by.id('dialogInput')).replaceText('Hay Nhat 111');172 await element(by.text('RENAME')).tap();173 await expect(element(by.text('Hay Nhat 111'))).toBeVisible();174 });175 // TC32176 it('should able to rename playlist', async () => {177 await expect(element(by.id('showOptionButton0'))).toBeVisible();178 await element(by.id('showOptionButton0')).tap();179 await expect(element(by.text('Rename'))).toBeVisible();180 await element(by.text('Rename')).tap();181 await expect(element(by.id('dialogInput'))).toBeVisible();182 await element(by.id('dialogInput')).replaceText('Hay Nhat 1111');183 await element(by.text('RENAME')).multiTap(2);184 await expect(element(by.text('Hay Nhat 1111'))).toBeVisible();185 });186 // TC20187 it('should able to rename alphabet playlist', async () => {188 await expect(element(by.id('showOptionButton0'))).toBeVisible();189 await element(by.id('showOptionButton0')).tap();190 await expect(element(by.text('Rename'))).toBeVisible();191 await element(by.text('Rename')).tap();192 await expect(element(by.id('dialogInput'))).toBeVisible();193 await element(by.id('dialogInput')).replaceText('abc');194 await element(by.text('RENAME')).tap();195 await expect(element(by.text('abc'))).toBeVisible();196 });197 // TC21198 it('should able to rename number name playlist', async () => {199 await expect(element(by.id('showOptionButton0'))).toBeVisible();200 await element(by.id('showOptionButton0')).tap();201 await expect(element(by.text('Rename'))).toBeVisible();202 await element(by.text('Rename')).tap();203 await expect(element(by.id('dialogInput'))).toBeVisible();204 await element(by.id('dialogInput')).replaceText('4567');205 await element(by.text('RENAME')).tap();206 await expect(element(by.text('4567'))).toBeVisible();207 });208 // TC22209 it('should able to rename special name playlist', async () => {210 await expect(element(by.id('showOptionButton0'))).toBeVisible();211 await element(by.id('showOptionButton0')).tap();212 await expect(element(by.text('Rename'))).toBeVisible();213 await element(by.text('Rename')).tap();214 await expect(element(by.id('dialogInput'))).toBeVisible();215 await element(by.id('dialogInput')).replaceText('4567');216 await element(by.text('RENAME')).tap();217 await expect(element(by.text('4567'))).toBeVisible();218 });219 // TC23220 it('should able to rename vietnamese name playlist', async () => {221 await expect(element(by.id('showOptionButton0'))).toBeVisible();222 await element(by.id('showOptionButton0')).tap();223 await expect(element(by.text('Rename'))).toBeVisible();224 await element(by.text('Rename')).tap();225 await expect(element(by.id('dialogInput'))).toBeVisible();226 await element(by.id('dialogInput')).replaceText('Playlist Hay Nhất');227 await element(by.text('RENAME')).tap();228 await expect(element(by.text('Playlist Hay Nhất'))).toBeVisible();229 });230 // TC24231 it('should able to rename lowercase name playlist', async () => {232 await expect(element(by.id('showOptionButton0'))).toBeVisible();233 await element(by.id('showOptionButton0')).tap();234 await expect(element(by.text('Rename'))).toBeVisible();235 await element(by.text('Rename')).tap();236 await expect(element(by.id('dialogInput'))).toBeVisible();237 await element(by.id('dialogInput')).replaceText('nhạc hay tháng');238 await element(by.text('RENAME')).tap();239 await expect(element(by.text('nhạc hay tháng'))).toBeVisible();240 });241 // TC25242 it('should able to rename uppercase name playlist', async () => {243 await expect(element(by.id('showOptionButton0'))).toBeVisible();244 await element(by.id('showOptionButton0')).tap();245 await expect(element(by.text('Rename'))).toBeVisible();246 await element(by.text('Rename')).tap();247 await expect(element(by.id('dialogInput'))).toBeVisible();248 await element(by.id('dialogInput')).replaceText('NHẠC HAY NÄM 2021');249 await element(by.text('RENAME')).tap();250 await expect(element(by.text('NHẠC HAY NÄM 2021'))).toBeVisible();251 });252 // TC26, TC27, TC28, TC29, TC30253 it('should able to rename uppercase name playlist', async () => {254 await expect(element(by.id('showOptionButton0'))).toBeVisible();255 await element(by.id('showOptionButton0')).tap();256 await expect(element(by.text('Rename'))).toBeVisible();257 await element(by.text('Rename')).tap();258 // Empty259 await expect(element(by.id('dialogInput'))).toBeVisible();260 await element(by.id('dialogInput')).replaceText('');261 await element(by.text('RENAME')).tap();262 await expect(element(by.text('RENAME'))).toBeVisible();263 // Space264 await element(by.id('dialogInput')).replaceText(' ');265 await element(by.text('RENAME')).tap();266 await expect(element(by.text('RENAME'))).toBeVisible();267 // Exist268 await element(by.id('dialogInput')).replaceText('abc');269 await element(by.text('RENAME')).tap();270 await expect(element(by.text('RENAME'))).toBeVisible();271 await element(by.text('CANCEL')).tap();272 await device.pressBack();273 });274 // Check delete playlist //275 // TC 13, 16, 17, 14276 it('should able to delete playlist ', async () => {277 await device.reloadReactNative();278 await element(by.id('libraryTab')).tap();279 await element(by.text('Playlists')).tap();280 await expect(element(by.id('showOptionButton1'))).toBeVisible();281 await element(by.id('showOptionButton1')).tap();282 await expect(element(by.text('Rename'))).toBeVisible();283 await expect(element(by.text('Delete'))).toBeVisible();284 await element(by.text('Delete')).tap();285 await expect(element(by.text('CANCEL'))).toBeVisible();286 await expect(element(by.text('DELETE'))).toBeVisible();287 await element(by.text('CANCEL')).tap();288 await expect(element(by.text('CANCEL'))).not.toBeVisible();289 await expect(element(by.text('DELETE'))).not.toBeVisible();290 await element(by.text('Delete')).tap();291 await element(by.text('CANCEL')).multiTap(2);292 await expect(element(by.text('CANCEL'))).not.toBeVisible();293 await expect(element(by.text('DELETE'))).not.toBeVisible();294 await element(by.text('Delete')).tap();295 await expect(element(by.text('DELETE'))).toBeVisible();296 await element(by.text('DELETE')).tap();297 await expect(element(by.text('Rename'))).not.toBeVisible();298 await expect(element(by.text('Delete'))).not.toBeVisible();299 });...
track.e2e.js
Source:track.e2e.js
...8 // await element(by.id('trackTab')).tap();9 });10 // TC0311 it('should show track screen after tap', async () => {12 await expect(element(by.id('trackScreen'))).toBeVisible();13 });14 // Check rename track //15 // TC52, TC53, TC68, TC6916 it('should show rename options', async () => {17 await expect(element(by.id('trackOption0'))).toBeVisible();18 await element(by.id('trackOption0')).tap();19 await expect(element(by.text('Rename'))).toBeVisible();20 await element(by.text('Rename')).tap();21 await expect(element(by.text('CANCEL'))).toBeVisible();22 await expect(element(by.text('RENAME'))).toBeVisible();23 // TC6824 await element(by.text('CANCEL')).tap();25 await expect(element(by.text('RENAME'))).not.toBeVisible();26 // TC6927 await element(by.text('Rename')).tap();28 await element(by.text('CANCEL')).multiTap(2);29 await expect(element(by.text('RENAME'))).not.toBeVisible();30 await device.pressBack();31 });32 // TC66, TC6733 it('should able to rename song', async () => {34 const songElement = element(35 by.label('Track Option').withAncestor(by.label('Laylalay')),36 );37 await expect(songElement).toBeVisible();38 await songElement.tap();39 await expect(element(by.text('Rename'))).toBeVisible();40 await element(by.text('Rename')).tap();41 await expect(element(by.id('dialogInput'))).toBeVisible();42 await element(by.id('dialogInput')).replaceText('Bai hat moi 123');43 await element(by.text('RENAME')).tap();44 await waitFor(element(by.text('Bai hat moi 123')))45 .toBeVisible()46 .withTimeout(5000);47 const newSongElement = element(48 by.label('Track Option').withAncestor(by.label('Bai hat moi 123')),49 );50 await expect(newSongElement).toBeVisible();51 await newSongElement.tap();52 await expect(element(by.text('Rename'))).toBeVisible();53 await element(by.text('Rename')).tap();54 await expect(element(by.id('dialogInput'))).toBeVisible();55 await element(by.id('dialogInput')).replaceText('Laylalay');56 await element(by.text('RENAME')).tap();57 await waitFor(element(by.text('Laylalay')))58 .toBeVisible()59 .withTimeout(5000);60 // should able to rename alphabet song61 const azElement = element(62 by.label('Track Option').withAncestor(by.label('Laylalay')),63 );64 await expect(azElement).toBeVisible();65 await azElement.tap();66 await expect(element(by.text('Rename'))).toBeVisible();67 await element(by.text('Rename')).tap();68 await expect(element(by.id('dialogInput'))).toBeVisible();69 await element(by.id('dialogInput')).replaceText('abcxyz');70 await element(by.text('RENAME')).tap();71 await waitFor(element(by.text('abcxyz')))72 .toBeVisible()73 .withTimeout(5000);74 // TC55 should able to rename number name song75 const numElement = element(by.label('Track Option').withAncestor(by.label('abcxyz')));76 await expect(numElement).toBeVisible();77 await numElement.tap();78 await expect(element(by.text('Rename'))).toBeVisible();79 await element(by.text('Rename')).tap();80 await expect(element(by.id('dialogInput'))).toBeVisible();81 await element(by.id('dialogInput')).replaceText('123456');82 await element(by.text('RENAME')).tap();83 await waitFor(element(by.text('123456')))84 .toBeVisible()85 .withTimeout(5000);86 // TC58 should able to rename lowercase name87 const lowerElement = element(88 by.label('Track Option').withAncestor(by.label('123456')),89 );90 await expect(lowerElement).toBeVisible();91 await lowerElement.tap();92 await expect(element(by.text('Rename'))).toBeVisible();93 await element(by.text('Rename')).tap();94 await expect(element(by.id('dialogInput'))).toBeVisible();95 await element(by.id('dialogInput')).replaceText('bai hat');96 await element(by.text('RENAME')).tap();97 await waitFor(element(by.text('bai hat')))98 .toBeVisible()99 .withTimeout(5000);100 // TC62 should able to rename uppercase name101 const upperElement = element(102 by.label('Track Option').withAncestor(by.label('bai hat')),103 );104 await expect(upperElement).toBeVisible();105 await upperElement.tap();106 await expect(element(by.text('Rename'))).toBeVisible();107 await element(by.text('Rename')).tap();108 await expect(element(by.id('dialogInput'))).toBeVisible();109 await element(by.id('dialogInput')).replaceText('BAI HAT UPPER');110 await element(by.text('RENAME')).tap();111 await waitFor(element(by.text('BAI HAT UPPER')))112 .toBeVisible()113 .withTimeout(5000);114 });115 // Check delete song //116 // TC 25, 26, 27, 28, 29117 it('should able to delete song ', async () => {118 await device.reloadReactNative();119 const songElement = element(120 by.label('Track Option').withAncestor(by.label('So Close')),121 );122 await expect(songElement).toBeVisible();123 await songElement.tap();124 await element(by.text('Delete')).tap();125 await expect(element(by.text('CANCEL'))).toBeVisible();126 await expect(element(by.text('DELETE'))).toBeVisible();127 await element(by.text('CANCEL')).tap();128 await expect(element(by.text('DELETE'))).not.toBeVisible();129 await element(by.text('Delete')).tap();130 await element(by.text('CANCEL')).multiTap(2);131 await expect(element(by.text('DELETE'))).not.toBeVisible();132 await element(by.text('Delete')).tap();133 await expect(element(by.text('DELETE'))).toBeVisible();134 await element(by.text('DELETE')).tap();135 await expect(element(by.text('Rename'))).not.toBeVisible();136 await expect(element(by.text('Delete'))).not.toBeVisible();137 });...
tracklist.e2e.js
Source:tracklist.e2e.js
...8 // await element(by.id('trackTab')).tap();9 });10 // TC0311 it('should show track screen after tap', async () => {12 await expect(element(by.id('trackScreen'))).toBeVisible();13 });14 // TC08, TC0915 it('should play track', async () => {16 const songElement = element(by.label('Nà ng Thơ'));17 await expect(songElement).toBeVisible();18 await songElement.tap();19 await expect(element(by.id('playerFooter'))).toBeVisible();20 await expect(element(by.text('Nà ng Thơ').withAncestor(by.id('playerFooter')))).toBeVisible()21 await expect(element(by.text('Hoà ng Dũng').withAncestor(by.id('playerFooter')))).toBeVisible()22 // Mutil tap23 await device.reloadReactNative();24 await element(by.id('trackTab')).tap();25 await expect(songElement).toBeVisible();26 await songElement.multiTap(2);27 28 await expect(element(by.id('playerFooter'))).toBeVisible();29 await expect(element(by.text('Nà ng Thơ').withAncestor(by.id('playerFooter')))).toBeVisible()30 await expect(element(by.text('Hoà ng Dũng').withAncestor(by.id('playerFooter')))).toBeVisible()31 });32 // TC10, TC11, TC17, TC1833 it('should able to show track options', async () => {34 const songElement = element(by.label('Track Option').withAncestor(by.label('Nà ng Thơ')));35 await expect(songElement).toBeVisible();36 await songElement.tap();37 await expect(element(by.text('Add to Playlist').withAncestor(by.id('optionsModal')))).toBeVisible()38 await expect(element(by.text('Share').withAncestor(by.id('optionsModal')))).toBeVisible()39 await expect(element(by.text('Rename').withAncestor(by.id('optionsModal')))).toBeVisible()40 await expect(element(by.text('Delete').withAncestor(by.id('optionsModal')))).toBeVisible()41 await device.pressBack();42 // Mutil tap43 await songElement.multiTap(2);44 await expect(element(by.text('Add to Playlist').withAncestor(by.id('optionsModal')))).toBeVisible()45 await expect(element(by.text('Share').withAncestor(by.id('optionsModal')))).toBeVisible()46 await expect(element(by.text('Rename').withAncestor(by.id('optionsModal')))).toBeVisible()47 await expect(element(by.text('Delete').withAncestor(by.id('optionsModal')))).toBeVisible()48 await device.pressBack();49 });50 // TC12, TC13, TC14, TC1551 it('should able to play and pause', async () => {52 await device.reloadReactNative();53 await element(by.id('trackTab')).tap();54 const songElement = element(by.label('Nà ng Thơ'));55 await expect(songElement).toBeVisible();56 await songElement.tap();57 await expect(element(by.id('playerFooter'))).toBeVisible();58 await expect(element(by.id('playIcon').withAncestor(by.id('playerFooter')))).toBeVisible()59 await element(by.id('playIcon').withAncestor(by.id('playerFooter'))).tap();60 await expect(element(by.id('pauseIcon').withAncestor(by.id('playerFooter')))).toBeVisible();61 // Mutil tap62 await element(by.id('pauseIcon').withAncestor(by.id('playerFooter'))).multiTap(3);63 await expect(element(by.id('playIcon').withAncestor(by.id('playerFooter')))).toBeVisible();64 });65 // TC1666 it('should show full player', async () => {67 const songElement = element(by.label('Nà ng Thơ'));68 await expect(songElement).toBeVisible();69 await songElement.tap();70 await expect(element(by.id('playerFooter'))).toBeVisible();71 await expect(element(by.text('Nà ng Thơ').withAncestor(by.id('playerFooter')))).toBeVisible()72 await element(by.text('Nà ng Thơ').withAncestor(by.id('playerFooter'))).tap();73 await expect(element(by.id('playerScreen'))).toBeVisible();74 await device.pressBack();75 });76 // TC19, TC20, TC2177 it('should able to add track to playlist', async () => {78 const songElement = element(by.label('Track Option').withAncestor(by.label('Nà ng Thơ')));79 await expect(songElement).toBeVisible();80 await songElement.tap();81 await expect(element(by.text('Add to Playlist').withAncestor(by.id('optionsModal')))).toBeVisible()82 await element(by.text('Add to Playlist').withAncestor(by.id('optionsModal'))).tap();83 await expect(element(by.id('addToPlaylistScreen'))).toBeVisible();84 await expect(element(by.text('Favourites'))).toBeVisible();85 await element(by.text('Favourites')).tap();86 await expect(element(by.id('trackScreen'))).toBeVisible();87 // Add exist track88 await songElement.tap();89 await expect(element(by.text('Add to Playlist').withAncestor(by.id('optionsModal')))).toBeVisible()90 await element(by.text('Add to Playlist').withAncestor(by.id('optionsModal'))).tap();91 await expect(element(by.text('Favourites'))).toBeVisible();92 await element(by.text('Favourites')).tap();93 await expect(element(by.id('addToPlaylistScreen'))).toBeVisible();94 });...
login.spec.js
Source:login.spec.js
...62 it('should not contain auth_type select input', function() {63 expect(authType.length).toEqual(0);64 });65 it('should hide help text', function() {66 expect(helpText).not.toBeVisible();67 });68 it('should show username and password inputs', function() {69 expect(userInput).toBeVisible();70 expect(passwordInput).toBeVisible();71 });72 });73 describe('when websso is enabled', function() {74 var element,75 helpText, authType,76 userInput, passwordInput,77 domainInput, regionInput;78 beforeEach(function() {79 element = $compile(webssoMarkup)($rootScope);80 authType = element.find('#id_auth_type');81 userInput = element.find("#id_username").parents('.form-group');82 passwordInput = element.find("#id_password").parents('.form-group');83 domainInput = element.find("#id_domain").parents('.form-group');84 regionInput = element.find("#id_region").parents('.form-group');85 helpText = element.find('.help_text');86 $rootScope.$apply();87 });88 it('should contain auth_type select input', function() {89 expect(authType.length).toEqual(1);90 });91 it('should show help text below auth_type', function() {92 expect(authType.next().get(0)).toEqual(helpText.get(0));93 });94 it('should show help text', function() {95 expect(helpText).toBeVisible();96 });97 it('should show username and password inputs', function() {98 expect(userInput).toBeVisible();99 expect(passwordInput).toBeVisible();100 });101 it('should hide username and password when authentication type is oidc', function() {102 authType.val('oidc');103 authType.change();104 $timeout.flush();105 expect(userInput).not.toBeVisible();106 expect(passwordInput).not.toBeVisible();107 });108 it('should show input fields when authentication type is credentials', function() {109 authType.val('credentials');110 authType.change();111 $timeout.flush();112 expect(userInput).toBeVisible();113 expect(passwordInput).toBeVisible();114 expect(domainInput).toBeVisible();115 expect(regionInput).toBeVisible();116 });117 });118 });...
scenarioSignUp.e2e.js
Source:scenarioSignUp.e2e.js
...9 await device.launchApp();10 });11 it('should sign up success', async () => {12 await waitFor(element(by.id(id.testIds.txtEmail)))13 .toBeVisible()14 .withTimeout(5000);15 await element(by.id(id.testIds.txtEmail)).typeText(accountCreate.email);16 await element(by.id(id.testIds.txtEmail)).tapReturnKey();17 await waitFor(element(by.id(id.testIds.txtPassword)))18 .toBeVisible()19 .withTimeout(5000);20 await element(by.id(id.testIds.txtPassword)).typeText(21 accountCreate.password,22 );23 await element(by.id(id.testIds.txtEmail)).tap();24 await element(by.id(id.testIds.txtEmail)).tapReturnKey();25 await waitFor(element(by.id(id.testIds.buttonLogin)))26 .toBeVisible()27 .withTimeout(5000);28 await element(by.id(id.testIds.buttonLogin)).tap();29 await waitFor(element(by.id(id.testIds.SignUp_Screen.buttonSignUp)))30 .toBeVisible()31 .withTimeout(5000);32 await waitFor(element(by.id(id.testIds.SignUp_Screen.buttonSignUp)))33 .toBeVisible()34 .withTimeout(5000);35 await element(by.id(id.testIds.SignUp_Screen.buttonSignUp)).tap();36 await waitFor(element(by.id(id.testIds.SignUp_Screen.textInputName)))37 .toBeVisible()38 .withTimeout(5000);39 await element(by.id(id.testIds.SignUp_Screen.textInputName)).typeText(40 'Nguyen Van A',41 );42 await element(by.id(id.testIds.SignUp_Screen.textInputName)).tapReturnKey();43 await waitFor(element(by.id(id.testIds.SignUp_Screen.textInputPhone)))44 .toBeVisible()45 .withTimeout(5000);46 await element(by.id(id.testIds.SignUp_Screen.textInputPhone)).typeText(47 '089013131',48 );49 await element(50 by.id(id.testIds.SignUp_Screen.textInputPhone),51 ).tapReturnKey();52 await waitFor(element(by.id(id.testIds.SignUp_Screen.textInputEmail)))53 .toBeVisible()54 .withTimeout(5000);55 await element(by.id(id.testIds.SignUp_Screen.textInputEmail)).typeText(56 accountCreate.email,57 );58 await element(59 by.id(id.testIds.SignUp_Screen.textInputEmail),60 ).tapReturnKey();61 await waitFor(element(by.id(id.testIds.SignUp_Screen.textInputPassword)))62 .toBeVisible()63 .withTimeout(5000);64 await element(by.id(id.testIds.SignUp_Screen.textInputPassword)).typeText(65 accountCreate.password,66 );67 await element(68 by.id(id.testIds.SignUp_Screen.textInputPassword),69 ).tapReturnKey();70 await waitFor(71 element(by.id(id.testIds.SignUp_Screen.textInputConfirmPassword)),72 )73 .toBeVisible()74 .withTimeout(5000);75 await element(76 by.id(id.testIds.SignUp_Screen.textInputConfirmPassword),77 ).typeText('123');78 await element(79 by.id(id.testIds.SignUp_Screen.textInputConfirmPassword),80 ).tapReturnKey();81 await element(by.id(id.testIds.SignUp_Screen.scrollView)).scrollTo(82 'bottom',83 );84 await waitFor(element(by.id(id.testIds.SignUp_Screen.buttonSignUp)))85 .toBeVisible()86 .withTimeout(5000);87 await element(by.id(id.testIds.SignUp_Screen.buttonSignUp)).tap();88 await waitFor(element(by.id(id.testIds.txtEmail)))89 .toBeVisible()90 .withTimeout(5000);91 await element(by.id(id.testIds.txtEmail)).clearText();92 await element(by.id(id.testIds.txtEmail)).typeText(accountCreate.email);93 await element(by.id(id.testIds.txtEmail)).tapReturnKey();94 await waitFor(element(by.id(id.testIds.txtPassword)))95 .toBeVisible()96 .withTimeout(5000);97 await element(by.id(id.testIds.txtPassword)).clearText();98 await element(by.id(id.testIds.txtPassword)).typeText(99 accountCreate.password,100 );101 await element(by.id(id.testIds.txtEmail)).tap();102 await element(by.id(id.testIds.txtEmail)).tapReturnKey();103 await waitFor(element(by.id(id.testIds.buttonLogin)))104 .toBeVisible()105 .withTimeout(5000);106 await element(by.id(id.testIds.buttonLogin)).tap();107 });...
brightcove-player.fructose.ios.js
Source:brightcove-player.fructose.ios.js
...22 });23 test(24 "renders",25 async () => {26 await expect(element(by.id("play"))).toBeVisible();27 await expect(element(by.id("jump-back"))).toBeVisible();28 await expect(element(by.id("current-time"))).toBeVisible();29 await expect(element(by.id("duration"))).toBeVisible();30 await expect(element(by.id("screen-mode"))).toBeVisible();31 },32 1000033 );34 test(35 "video plays",36 async () => {37 await element(by.id("play")).tap();38 await waitFor(element(by.id("current-time")))39 .toHaveText("00:01")40 .withTimeout(1500);41 await expect(42 element(by.id("current-time").and(by.text("00:00")))43 ).toNotExist();44 },45 2000046 );47 }48);49withComponent(50 <View fructoseID="multiple brightcove players">51 <View testID="player1">52 <BrightcovePlayer53 accountId={accountId}54 policyKey={policyKey}55 videoId={videoId}56 />57 </View>58 <View testID="player2">59 <BrightcovePlayer60 accountId={accountId}61 policyKey={policyKey}62 videoId={videoId}63 />64 </View>65 </View>,66 "multiple brightcove players",67 async fructose => {68 const player1 = id => element(by.id("player1").withDescendant(by.id(id)));69 const player2 = id => element(by.id("player2").withDescendant(by.id(id)));70 beforeEach(async () => {71 await device.launchApp({ newInstance: true });72 await fructose.loadComponent();73 });74 test("renders player1", async () => {75 await expect(player1("play")).toBeVisible();76 await expect(player1("jump-back")).toBeVisible();77 await expect(player1("current-time")).toBeVisible();78 await expect(player1("duration")).toBeVisible();79 await expect(player1("screen-mode")).toBeVisible();80 });81 test("renders player2", async () => {82 await expect(player2("play")).toBeVisible();83 await expect(player2("jump-back")).toBeVisible();84 await expect(player2("current-time")).toBeVisible();85 await expect(player2("duration")).toBeVisible();86 await expect(player2("screen-mode")).toBeVisible();87 });88 }89);90withComponent(91 <VideoWithExternalControls92 accountId={accountId}93 fructoseID="brightcove with external controls"94 policyKey={policyKey}95 videoId={videoId}96 />,97 "video with external controls",98 async fructose => {99 beforeEach(async () => {100 await device.launchApp({ newInstance: true });101 await fructose.loadComponent();102 });103 test("renders", async () => {104 await expect(element(by.id("external-play"))).toBeVisible();105 await expect(element(by.id("external-pause"))).toBeVisible();106 await expect(element(by.id("external-reset"))).toBeVisible();107 await expect(element(by.id("splash-component"))).toBeVisible();108 });109 test(110 "video plays when external play button is pressed",111 async () => {112 await element(by.id("external-play")).tap();113 await waitFor(element(by.id("current-time")))114 .toHaveText("00:01")115 .withTimeout(5000);116 await expect(117 element(by.id("current-time").and(by.text("00:00")))118 ).toNotExist();119 },120 10000121 );...
firstTest.e2e.js
Source:firstTest.e2e.js
...3 beforeEach(async () => {4 await device.reloadReactNative()5 })6 it('should have weather component', async () => {7 await expect(element(by.id('weatherComponent'))).toBeVisible()8 })9 it('should have nepali date', async () => {10 await expect(element(by.id('nepaliDate'))).toBeVisible()11 })12 it('should load headline article in home', async () => {13 await expect(element(by.id('headlineTitle'))).toBeVisible()14 })15 it('should load article in home', async () => {16 await element(by.id('homeArticle1')).swipe('up', 'fast', 0.9);17 await expect(element(by.id('homeArticle1'))).toBeVisible()18 })19 it('should show article detail', async () => {20 await element(by.id('homeArticle1')).tap()21 await expect(element(by.id('articleDetail1'))).toBeVisible()22 })23 it('should load category page', async () => {24 await element(by.id('categoryScreen')).tap()25 await expect(element(by.text('समाà¤à¤¾à¤°'))).toBeVisible()26 })27 it('should load article in category', async () => {28 await element(by.id('categoryScreen')).tap()29 await expect(element(by.id('headlineArticle1'))).toBeVisible()30 })31 it('should go to corona screen', async () => {32 await element(by.id('coronaScreen')).tap()33 await expect(element(by.text('राषà¥à¤à¥à¤°à¤¿à¤¯'))).toBeVisible()34 await expect(element(by.id('totalCase'))).toBeVisible()35 await expect(element(by.id('district1'))).toBeVisible()36 await expect(element(by.id('districtTotalKathmandu'))).toBeVisible()37 })38 it('should go to international corona screen', async () => {39 await element(by.id('coronaScreen')).tap()40 await element(by.text('à¤
नà¥à¤¤à¤°à¥à¤°à¤¾à¤·à¥à¤à¥à¤°à¤¿à¤¯')).tap()41 await expect(element(by.id('worldTotalCaseIndia'))).toBeVisible()42 })43 it('should go to trending tweets screen', async () => {44 await element(by.id('trendingScreen')).tap()45 await expect(element(by.id('twitter1'))).toBeVisible()46 })47 it('should go to trending figures screen', async () => {48 await element(by.id('trendingScreen')).tap()49 await element(by.text('à¤à¥à¤°à¥à¤£à¥à¤¡à¤¿à¤ वà¥à¤¯à¤à¥à¤¤à¤¿à¤¹à¤°à¥')).tap()50 await expect(element(by.id('category1'))).toBeVisible()51 await expect(element(by.id('category11'))).toBeVisible()52 await element(by.id('category11')).tap()53 await expect(element(by.text('समाà¤à¤¾à¤°'))).toBeVisible()54 })55 it('should go to fm screen', async () => {56 await element(by.id('radioScreen')).tap()57 await element(by.id('header1')).tap()58 await element(by.id('content11')).tap()59 await expect(element(by.id('bottomPlayer'))).toBeVisible()60 await element(by.id('stopPlayer')).tap()61 })...
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const element = await page.$('text=Get started');7 await browser.close();8})();9const { chromium } = require('playwright');10(async () => {11 const browser = await chromium.launch();12 const context = await browser.newContext();13 const page = await context.newPage();14 const element = await page.$('text=Get started');15 await browser.close();16})();17const { chromium } = require('playwright');18(async () => {19 const browser = await chromium.launch();20 const context = await browser.newContext();21 const page = await context.newPage();22 const element = await page.$('text=Get started');23 await browser.close();24})();25const { chromium } = require('playwright');26(async () => {27 const browser = await chromium.launch();28 const context = await browser.newContext();29 const page = await context.newPage();30 const element = await page.$('text=Get started');31 await browser.close();32})();33const { chromium } = require('playwright');34(async () => {35 const browser = await chromium.launch();36 const context = await browser.newContext();37 const page = await context.newPage();38 const element = await page.$('text=Get started');39 await browser.close();40})();41const { chromium } = require('playwright');42(async () => {
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const page = await browser.newPage();5 await page.waitForSelector('text=Get started');6 await page.click('text=Get started');7 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');8 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');9 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');10 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');11 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');12 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');13 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');14 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');15 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');16 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');17 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');18 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');19 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');20 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');21 await page.waitForSelector('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');22 await page.click('text=Playwright is a Node library to automate Chromium, Firefox and WebKit with a single API');23 await page.waitForSelector('text=Playwright
Using AI Code Generation
1const { test, expect } = require('@playwright/test');2test('test', async ({ page }) => {3 const button = page.locator('text=Get Started');4 await expect(button).toBeVisible();5});6const { test, expect } = require('@playwright/test');7test('test', async ({ page }) => {8 const button = page.locator('text=Get Started');9 await expect(button).toBeVisible();10});11const { test, expect } = require('@playwright/test');12test('test', async ({ page }) => {13 const button = page.locator('text=Get Started');14 await expect(button).toBeVisible();15});16const { test, expect } = require('@playwright/test');17test('test', async ({ page }) => {18 const button = page.locator('text=Get Started');19 await expect(button).toBeVisible();20});21const { test, expect } = require('@playwright/test');22test('test', async ({ page }) => {23 const button = page.locator('text=Get Started');24 await expect(button).toBeVisible();25});26const { test, expect } = require('@playwright/test');27test('test', async ({ page }) => {28 const button = page.locator('text=Get Started');29 await expect(button).toBeVisible();30});
Using AI Code Generation
1const { test, expect } = require('@playwright/test');2test('toBeVisible API', async ({ page }) => {3 await expect(page.locator('text=Get Started')).toBeVisible();4});5const { test, expect } = require('@playwright/test');6test('toBeVisible API', async ({ page }) => {7 await expect(page.locator('text=Get Started')).toBeVisible();8});9const { test, expect } = require('@playwright/test');10test('toBeVisible API', async ({ page }) => {11 await expect(page.locator('text=Get Started')).toBeVisible();12});13const { test, expect } = require('@playwright/test');14test('toBeVisible API', async ({ page }) => {15 await expect(page.locator('text=Get Started')).toBeVisible();16});17const { test, expect } = require('@playwright/test');18test('toBeVisible API', async ({ page }) => {19 await expect(page.locator('text=Get Started')).toBeVisible();20});21const { test, expect } = require('@playwright/test');22test('toBeVisible API', async ({ page }) => {23 await expect(page.locator('text=Get Started')).toBeVisible();24});25const { test, expect } = require('@playwright/test');26test('toBeVisible API', async ({ page }) => {27 await expect(page.locator('text=Get Started')).toBeVisible();28});29const { test, expect } = require('@playwright/test');30test('toBeVisible API', async ({ page }) => {
Using AI Code Generation
1const { test, expect } = require('@playwright/test');2test('Verify the visibility of the element', async ({ page }) => {3 const element = page.locator('text=Get started');4 await expect(element).toBeVisible();5});6const { test, expect } = require('@playwright/test');7test('Verify the visibility of the element', async ({ page }) => {8 const element = page.locator('text=Get started');9 await expect(element).toHaveAttribute('aria-disabled', 'false');10});11const { test, expect } = require('@playwright/test');12test('Verify the visibility of the element', async ({ page }) => {13 const element = page.locator('text=Get started');14 await expect(element).toBeVisible();15});16const { test, expect } = require('@playwright/test');17test('Verify the visibility of the element', async ({ page }) => {18 const element = page.locator('text=Get started');19 await expect(element).toBeVisible();20});21const { test, expect } = require('@playwright/test');22test('Verify the visibility of the element', async ({ page }) => {23 const element = page.locator('text=Get started');24 await expect(element).toBeVisible();25});26const { test, expect } = require('@playwright/test');27test('Verify the visibility of the element', async ({ page }) => {
Using AI Code Generation
1console.log(await page.isVisible('text=Playwright'));2console.log(await page.isVisible('text=Playwright'));3console.log(await page.isVisible('text=Playwright'));4expect(await page.isVisible('text=Playwright')).toBeVisible();5expect(await page.isVisible('text=Playwright')).toBeVisible();6expect(await page.isVisible('text=Playwright')).toBeVisible();7expect(await page.isVisible('text=Playwright')).toBeVisible();8expect(await page.isVisible('text=Playwright')).toBeVisible();9expect(await page.isVisible('text=Playwright')).toBeVisible();10expect(await page.isVisible('text=Playwright
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!