streamlit
1/**
2* Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
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*/
16
17// Audio + video tests, but we rerun the page to ensure everything shows up
18// when the value is replayed from the cache
19
20describe("media replay", () => {21before(() => {22// Increasing timeout since we're requesting external files23Cypress.config("defaultCommandTimeout", 10000);24cy.loadApp("http://localhost:3000/");25});26
27it("displays an audio player", () => {28cy.get(".element-container .stAudio");29cy.rerunScript();30cy.waitForRerun();31cy.get(".element-container .stAudio");32});33
34it("has audio controls", () => {35cy.get(".element-container .stAudio").should("have.attr", "controls");36cy.rerunScript();37cy.waitForRerun();38cy.get(".element-container .stAudio").should("have.attr", "controls");39});40
41it("has audio src", () => {42cy.get(".element-container .stAudio").should("have.attr", "src");43cy.rerunScript();44cy.waitForRerun();45cy.get(".element-container .stAudio").should("have.attr", "src");46});47
48it("has audio", () => {49cy.get(".element-container .stAudio")50.should("have.prop", "tagName")51.and("eq", "AUDIO");52cy.rerunScript();53cy.waitForRerun();54cy.get(".element-container .stAudio")55.should("have.prop", "tagName")56.and("eq", "AUDIO");57});58
59it("displays a video player", () => {60cy.get(".element-container .stVideo").should("have.attr", "src");61cy.rerunScript();62cy.waitForRerun();63cy.get(".element-container .stVideo").should("have.attr", "src");64});65});66