Skip to content

Commit 3c1a6b8

Browse files
author
Nate Rush
authored
Merge pull request #1258 from mito-ds/less-flaky
Attempt to make tests less flaky
2 parents 9cbef8a + aad4400 commit 3c1a6b8

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

mitosheet/css/mito.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
}
6262

6363
.mito-container {
64-
height: var(--mito-height);
64+
height: var(--mito-height, 538px); /* Default height */
6565
display: flex;
6666
flex-direction: column;
6767

mitosheet/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def get_data_files_from_data_files_spec(
135135
"setuptools==56.0.0"
136136
],
137137
'streamlit': [
138-
'streamlit>=1.24',
138+
'streamlit>=1.24,<1.32',
139139
],
140140
'optional_feature_dependencies': [
141141
# According to this documentation (https://github.com/snowflakedb/snowflake-connector-python),

tests/extra-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
streamlit
1+
streamlit<1.32
22
dash

tests/streamlit_ui_tests/taskpanes/file_import.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { expect, test } from '@playwright/test';
3-
import { checkColumnCellsHaveExpectedValues, checkOpenTaskpane, clickButtonAndAwaitResponse, clickTab, getMitoFrame, getMitoFrameWithTestCSV } from '../utils';
3+
import { awaitResponse, checkColumnCellsHaveExpectedValues, checkOpenTaskpane, clickButtonAndAwaitResponse, clickTab, getMitoFrame, getMitoFrameWithTestCSV } from '../utils';
44

55
const openImportTaskpaneAndSelectData = async (mito: any, file: string) => {
66
await mito.locator('.mito-toolbar-button', { hasText: 'Import' }).click();
@@ -9,7 +9,7 @@ const openImportTaskpaneAndSelectData = async (mito: any, file: string) => {
99
}
1010

1111
test.describe('File Import Taskpane', () => {
12-
12+
1313
test('Test import CSV file', async ({ page }) => {
1414
const mito = await getMitoFrameWithTestCSV(page);
1515
await clickTab(page, mito, 'Data');
@@ -20,8 +20,7 @@ test.describe('File Import Taskpane', () => {
2020

2121
test('Test import CSV File with double click', async ({ page }) => {
2222
const mito = await getMitoFrame(page);
23-
await mito.getByRole('button', { name: 'Import Files' }).click();
24-
await mito.getByText('test.csv').dblclick();
23+
await openImportTaskpaneAndSelectData(mito, 'test.csv')
2524
await expect(mito.getByTitle('Column1')).toBeVisible();
2625
});
2726

@@ -146,7 +145,8 @@ test.describe('File Import Taskpane', () => {
146145
const mito = await getMitoFrame(page);
147146

148147
// Open the configure taskpane for the csv with special delimiters
149-
await mito.getByText('Import Files').click();
148+
await mito.locator('.mito-toolbar-button', { hasText: 'Import' }).click();
149+
await mito.locator('.mito-dropdown-item', { hasText: 'Import Files' }).click();
150150
await mito.getByText('semicolon-delimiter.csv').click();
151151
await mito.getByText('Configure').click();
152152

tests/streamlit_ui_tests/utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { FormulaType } from './types';
44

55
export const getMitoFrame = async (page: Page): Promise<FrameLocator> => {
66
await page.goto('http://localhost:8555/');
7-
return page.frameLocator('iframe[title="mitosheet\\.streamlit\\.v1\\.spreadsheet\\.my_component"]');
7+
const mito = page.frameLocator('iframe[title="mitosheet\\.streamlit\\.v1\\.spreadsheet\\.my_component"]');
8+
await expect(mito.locator('.text-button:not(.text-button-disabled)', { hasText: 'Import Files' })).toBeVisible();
9+
return mito;
810
};
911

1012
export const importCSV = async (page: Page, mito: FrameLocator, filename: string): Promise<void> => {

0 commit comments

Comments
 (0)