1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16import {browser, by, element} from 'protractor'; 17import {E2eTestUtils} from './utils'; 18 19describe('Viewer ScreenRecording', () => { 20 beforeAll(async () => { 21 browser.manage().timeouts().implicitlyWait(1000); 22 await E2eTestUtils.checkServerIsUp('Winscope', E2eTestUtils.WINSCOPE_URL); 23 await browser.get(E2eTestUtils.WINSCOPE_URL); 24 }); 25 26 it('processes trace and renders view', async () => { 27 await E2eTestUtils.uploadFixture( 28 'traces/elapsed_and_real_timestamp/screen_recording_metadata_v2.mp4' 29 ); 30 await E2eTestUtils.closeSnackBarIfNeeded(); 31 await E2eTestUtils.clickViewTracesButton(); 32 33 const viewer = element(by.css('viewer-screen-recording')); 34 expect(await viewer.isPresent()).toBeTruthy(); 35 36 const video = element(by.css('viewer-screen-recording video')); 37 expect(await video.isPresent()).toBeTruthy(); 38 expect(await video.getAttribute('src')).toContain('blob:'); 39 expect(await video.getAttribute('currentTime')).toBeCloseTo(0, 0.001); 40 }); 41}); 42