-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoquality.cy.js
33 lines (27 loc) · 1.14 KB
/
videoquality.cy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class VideoQuality {
visit() {
cy.visit('https://www.youtube.com'); // Visit YouTube homepage
}
search(query) {
cy.get('input#search').clear().type(query); // Type in search
cy.get('button#search-icon-legacy').click(); // Click search button
}
clickFirstVideo() {
cy.get('ytd-video-renderer').first().click(); // Click the first video from search results
}
openQualityMenu() {
// Click the quality button on the video player
cy.get('.ytp-settings-button').click(); // Open settings menu
cy.contains('Quality').click(); // Click on "Quality" option in the menu
}
selectQuality(quality) {
// Select a video quality (e.g., 1080p, 720p, etc.)
cy.contains(quality).click(); // Click the desired quality (like '1080p')
}
verifyQualitySelected(quality) {
// Ensure the selected quality is shown in the quality menu
cy.get('.ytp-settings-button').click(); // Open settings again
cy.contains(quality).should('have.class', 'ytp-selected'); // Verify selected quality
}
}
export default VideoQuality;