-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update names (for 0.8) and IDs (for 1.0) in the editor. (#570)
- Loading branch information
Showing
15 changed files
with
249 additions
and
132 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,42 +1,47 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import 'cypress-file-upload'; | ||
import 'cypress-iframe'; | ||
import "cypress-file-upload"; | ||
import "cypress-iframe"; | ||
|
||
describe("Create a resource manually", () => { | ||
it("should allow adding a FileObject resource", () => { | ||
cy.visit("http://localhost:8501"); | ||
cy.get("button").contains("Create").click(); | ||
cy.get('input[aria-label="Name:red[*]"]').type("MyDataset{enter}"); | ||
cy.contains("Croissant files are composed of three layers:"); | ||
cy.enter('[title="components.tabs.tabs_component"]').then((getBody) => { | ||
getBody().contains("Metadata").click(); | ||
}); | ||
cy.get('input[aria-label="URL"]').type("https://mydataset.com{enter}", { | ||
force: true, | ||
}); | ||
|
||
describe('Create a resource manually', () => { | ||
it('should allow adding a FileObject resource', () => { | ||
// Streamlit starts on :8501. | ||
cy.visit('http://localhost:8501') | ||
cy.get('button').contains('Create').click() | ||
cy.get('input[aria-label="Name:red[*]"]').type('MyDataset{enter}') | ||
cy.contains("Croissant files are composed of three layers:") | ||
cy.enter('[title="components.tabs.tabs_component"]').then(getBody => { | ||
getBody().contains('Metadata').click() | ||
}) | ||
cy.get('input[aria-label="URL"]').type('https://mydataset.com{enter}', {force: true}) | ||
|
||
// Create a resource manually. | ||
cy.enter('[title="components.tabs.tabs_component"]').then(getBody => { | ||
getBody().contains('Resources').click() | ||
}) | ||
cy.get('[data-testid="stMarkdownContainer"]').contains('Add manually').click() | ||
cy.get('button').contains('Upload').click() | ||
|
||
cy.enter('[title="components.tabs.tabs_component"]').then((getBody) => { | ||
getBody().contains("Resources").click(); | ||
}); | ||
cy.get('[data-testid="stMarkdownContainer"]') | ||
.contains("Add manually") | ||
.click(); | ||
cy.get("button").contains("Upload").click(); | ||
|
||
// The file is created, so we can click on it to see the details. | ||
cy.enter('[title="components.tree.tree_component"]').then(getBody => { | ||
getBody().contains('file_object').click() | ||
}) | ||
cy.enter('[title="components.tree.tree_component"]').then((getBody) => { | ||
getBody().contains("file_object").click(); | ||
}); | ||
// We can edit it | ||
cy.get('input[aria-label="Name:red[*]"]').type('{selectall}{backspace}test.csv{enter}') | ||
cy.wait(1000) | ||
cy.enter('[title="components.tree.tree_component"]').then(getBody => { | ||
getBody().contains('test.csv').click() | ||
}) | ||
cy.get('input[aria-label="SHA256:red[*]"]').type('abcdefgh1234567{enter}') | ||
cy.get('input[aria-label="ID:red[*]"]').type( | ||
"{selectall}{backspace}test.csv{enter}" | ||
); | ||
cy.wait(1000); | ||
cy.enter('[title="components.tree.tree_component"]').then((getBody) => { | ||
getBody().contains("test.csv").click(); | ||
}); | ||
cy.get('input[aria-label="SHA256:red[*]"]').type("abcdefgh1234567{enter}"); | ||
|
||
cy.get('input[aria-label="SHA256:red[*]"]') | ||
.should('have.value', 'abcdefgh1234567') | ||
}) | ||
}) | ||
cy.get('input[aria-label="SHA256:red[*]"]').should( | ||
"have.value", | ||
"abcdefgh1234567" | ||
); | ||
}); | ||
}); |
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.