Skip to content

Commit

Permalink
Use tabs for create/load dataset steps
Browse files Browse the repository at this point in the history
  • Loading branch information
aidazolic committed Nov 10, 2023
1 parent 54df95d commit 64fc94e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
6 changes: 3 additions & 3 deletions wizard/cypress/e2e/loadCroissant.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ describe('Wizard loads Croissant without Error', () => {
events: ["dragenter", "drop"],
})
})
cy.get('[data-testid="stExpander"]')
.contains('Titanic')
.should('exist')

cy.get('[data-testid="stMarkdownContainer"]').contains('Metadata').click()
cy.get('input[aria-label="Name:red[*]"]').should('have.value', 'Titanic')

cy.get('[data-testid="stException"]').should('not.exist')
})
Expand Down
10 changes: 7 additions & 3 deletions wizard/cypress/e2e/uploadCsv.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import 'cypress-file-upload';

describe('Wizard from local CSV', () => {
it('should display the form: Metadata, Files, & Record Sets', () => {
it('should display the form: Overview, Metadata, Resources, & Record Sets', () => {
// Streamlit starts on :8501.
cy.visit('http://localhost:8501')
cy.get('button').contains('Create').click()

cy.get('[data-testid="stMarkdownContainer"]')
.contains('Metadata')
.click()
cy.get('input[aria-label="Name:red[*]"]').type('MyDataset').blur()
cy.get('input[aria-label="URL:red[*]"]').type('https://mydataset.com').blur()
cy.get('[data-testid="stMarkdownContainer"]').contains('Files').click()
cy.get('input[aria-label="URL:red[*]"]').type('https://mydataset.com', {force: true})

cy.get('[data-testid="stMarkdownContainer"]').contains('Resources').click()
// Drag and drop mimicking: streamlit/e2e/specs/st_file_uploader.spec.js.
cy.fixture('base.csv').then((fileContent) => {
const file = {
Expand Down
2 changes: 2 additions & 0 deletions wizard/views/overview.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def render_overview():
pass
16 changes: 13 additions & 3 deletions wizard/views/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
from core.state import CurrentStep
from views.files import render_files
from views.metadata import render_metadata
from views.overview import render_overview
from views.record_sets import render_record_sets

OVERVIEW = "Overview"
METADATA = "Metadata"
RESOURCES = "Resources"
RECORD_SETS = "Record sets"


def render_wizard():
with st.expander("Metadata", expanded=True):
tab1, tab2, tab3, tab4 = st.tabs([OVERVIEW, METADATA, RESOURCES, RECORD_SETS])

with tab1:
render_overview()
with tab2:
render_metadata()
with st.expander("Files"):
with tab3:
render_files()
with st.expander("Record Sets"):
with tab4:
render_record_sets()

0 comments on commit 64fc94e

Please sign in to comment.