forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* parameterize cypress tests * separate out flaky files and update scripts to handle flakes * cleanup circle config * clean up yarn script names * update nvm version
- Loading branch information
Showing
24 changed files
with
433 additions
and
323 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../e2e/scripts/st_add_rows.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../e2e/scripts/st_bokeh_chart.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../e2e/scripts/st_empty.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../e2e/scripts/st_graphviz_chart.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../e2e/scripts/st_in_cache_warning.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../e2e/scripts/st_pyplot_kwargs.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* @license | ||
* Copyright 2018-2020 Streamlit Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
describe("st.add_rows", () => { | ||
// Doesn't have to run before each, since these tests are stateless. | ||
before(() => { | ||
cy.visit("http://localhost:3000/"); | ||
|
||
// Rerun the script because we want to test that JS-side coalescing works. | ||
cy.get(".stApp .decoration").trigger("keypress", { | ||
keyCode: 82, // "r" | ||
which: 82 // "r" | ||
}); | ||
|
||
// Wait for 'stale-element' class to go away, so the snapshot looks right. | ||
cy.get(".element-container").should("not.have.class", "stale-element"); | ||
|
||
// Make the ribbon decoration line disappear | ||
cy.get(".decoration").invoke("css", "display", "none"); | ||
}); | ||
|
||
beforeEach(() => { | ||
// Check that the app is fully loaded | ||
return cy.get(".element-container").should("have.length", 26); | ||
}); | ||
|
||
it("correctly adds rows to charts", () => { | ||
cy.get(".element-container .stVegaLiteChart").each((el, i) => { | ||
return cy.get(el).matchImageSnapshot(`stVegaLiteChart-${i}`); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @license | ||
* Copyright 2018-2020 Streamlit Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
describe("st.bokeh_chart", () => { | ||
before(() => { | ||
cy.visit("http://localhost:3000/"); | ||
}); | ||
|
||
it("displays a bokeh chart", () => { | ||
cy.get(".element-container .stBokehChart").should( | ||
"have.css", | ||
"height", | ||
"600px" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @license | ||
* Copyright 2018-2020 Streamlit Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
describe("st.empty", () => { | ||
before(() => { | ||
cy.visit("http://localhost:3000/"); | ||
|
||
// Make the ribbon decoration line disappear | ||
cy.get(".decoration").invoke("css", "display", "none"); | ||
}); | ||
|
||
it("matches the snapshot", () => { | ||
cy.get(".block-container").matchImageSnapshot("stEmpty"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* @license | ||
* Copyright 2018-2020 Streamlit Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
describe("st.graphviz_chart", () => { | ||
before(() => { | ||
cy.visit("http://localhost:3000/"); | ||
|
||
// Make the ribbon decoration line disappear | ||
cy.get(".decoration").invoke("css", "display", "none"); | ||
}); | ||
|
||
beforeEach(() => { | ||
return cy.get(".stGraphVizChart").should("have.length", 3); | ||
}); | ||
|
||
it("displays a graph with two connected nodes", () => { | ||
cy.get("#graphviz-chart-0 svg").matchImageSnapshot("graphviz-chart-0"); | ||
}); | ||
|
||
it("displays a colorful node within a cluster within a graph", () => { | ||
cy.get("#graphviz-chart-1 svg").matchImageSnapshot("graphviz-chart-1"); | ||
}); | ||
|
||
it("displays a graph representing a finite state machine", () => { | ||
cy.get("#graphviz-chart-2 svg").matchImageSnapshot("graphviz-chart-2"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* @license | ||
* Copyright 2018-2020 Streamlit Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
describe("st calls within cached functions", () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:3000/"); | ||
}); | ||
|
||
it("displays expected results", () => { | ||
// We should have two alerts | ||
cy.get(".element-container > .alert-warning").should("have.length", 2); | ||
|
||
// One button | ||
cy.get(".element-container > .stButton").should("have.length", 1); | ||
|
||
// And two texts | ||
cy.get(".element-container > .markdown-text-container").should( | ||
"have.length", | ||
3 | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @license | ||
* Copyright 2018-2020 Streamlit Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
describe("st.pyplot with kwargs", () => { | ||
before(() => { | ||
cy.visit("http://localhost:3000/"); | ||
|
||
// Wait for the site to be fully loaded | ||
cy.contains("Done!", { timeout: 100000 }).should($els => { | ||
expect($els).to.have.length.of.at.least(1); | ||
}); | ||
|
||
// Make the ribbon decoration line disappear | ||
cy.get(".decoration").invoke("css", "display", "none"); | ||
}); | ||
|
||
it("draws long text strings correctly", () => { | ||
cy.get(".stImage") | ||
.find("img") | ||
.should("have.attr", "src"); | ||
cy.get(".stImage > img").matchImageSnapshot("pyplot-long-text-strings"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.