|
9 | 9 | DATASETS_TO_REFRESH, |
10 | 10 | ORGANIZATION_WITH_DEFAULT_ROLE_USER, |
11 | 11 | } from '../../fixtures/stubbing/DatasetManager'; |
| 12 | +import { RUNNERS_FOR_ETL_DATASETS } from '../../fixtures/stubbing/DatasetManager/runners'; |
| 13 | +import { SOLUTION_WITH_TRANSLATED_RUN_TEMPLATES } from '../../fixtures/stubbing/DatasetManager/solutions'; |
12 | 14 | import { USER_EXAMPLE } from '../../fixtures/stubbing/default'; |
13 | 15 |
|
14 | 16 | const WORKSPACES = [WORKSPACE]; |
@@ -43,30 +45,48 @@ describe('Data edition in dataset manager', () => { |
43 | 45 | before(() => { |
44 | 46 | stub.start(); |
45 | 47 | stub.setWorkspaces(WORKSPACES); |
| 48 | + stub.setSolutions([SOLUTION_WITH_TRANSLATED_RUN_TEMPLATES]); |
46 | 49 | // we use the copy of DATASETS array to be able to reuse the same fixture |
47 | 50 | // in all tests in the suite. The cypress doc says that "fixture files are |
48 | 51 | // assumed to be unchanged during the test, and thus Cypress loads them just once", |
49 | 52 | // perhaps, we are modifying the list while creating and deleting datasets, so, |
50 | 53 | // to keep the same list at the beginning of every describe block, we provide a copy |
51 | 54 | // to stubbing function |
52 | 55 | stub.setDatasets([...DATASETS]); |
| 56 | + stub.setRunners(RUNNERS_FOR_ETL_DATASETS); |
53 | 57 | }); |
54 | 58 | beforeEach(() => Login.login({ url: '/W-stbbdbrwryWithDM', workspaceId: 'W-stbbdbrwryWithDM' })); |
55 | 59 | after(stub.stop); |
56 | 60 |
|
57 | | - it('can edit datasets metadata', () => { |
| 61 | + it('can display and edit datasets metadata', () => { |
58 | 62 | const DATASET_A = DATASETS[0]; |
59 | 63 | const DATASET_B = DATASETS[1]; |
| 64 | + const DATASET_ETL = DATASETS[3]; |
| 65 | + const SUBDATASET = DATASETS[4]; |
60 | 66 | const DATASET_Z = DATASETS[2]; // Non-main dataset |
61 | 67 |
|
62 | 68 | DatasetManager.ignoreDatasetTwingraphQueries(); |
63 | 69 | DatasetManager.switchToDatasetManagerView(); |
64 | 70 |
|
65 | | - DatasetManager.getDatasetsListItemButtons().should('have.length', 2); |
| 71 | + DatasetManager.getDatasetsListItemButtons().should('have.length', 4); |
66 | 72 | DatasetManager.getDatasetsListItemButton(DATASET_A.id).should('be.visible'); |
67 | 73 | DatasetManager.getDatasetsListItemButton(DATASET_B.id).should('be.visible'); |
| 74 | + DatasetManager.getDatasetsListItemButton(DATASET_ETL.id).should('be.visible'); |
| 75 | + DatasetManager.getDatasetsListItemButton(SUBDATASET.id).should('be.visible'); |
68 | 76 | DatasetManager.getDatasetsListItemButton(DATASET_Z.id).should('not.exist'); |
69 | 77 |
|
| 78 | + DatasetManager.selectDatasetById(DATASET_ETL.id); |
| 79 | + DatasetManager.getDatasetMetadataSourceType().should( |
| 80 | + 'have.text', |
| 81 | + 'Source:' + 'ETL run template with dynamic filter' |
| 82 | + ); |
| 83 | + |
| 84 | + DatasetManager.selectDatasetById(SUBDATASET.id); |
| 85 | + DatasetManager.getDatasetMetadataSourceType().should( |
| 86 | + 'have.text', |
| 87 | + 'Source:' + 'Subdataset run template with static filter' |
| 88 | + ); |
| 89 | + |
70 | 90 | DatasetManager.selectDatasetById(DATASET_A.id); |
71 | 91 | DatasetManager.getDatasetMetadataDescription().should('contain', DATASET_A.description); |
72 | 92 | DatasetManager.getDatasetMetadataTags().should('have.length', 2); |
@@ -136,7 +156,7 @@ describe('Dataset creation', () => { |
136 | 156 |
|
137 | 157 | DatasetManager.ignoreDatasetTwingraphQueries(); |
138 | 158 | DatasetManager.switchToDatasetManagerView(); |
139 | | - DatasetManager.getDatasetsListItemButtons().should('have.length', 2); |
| 159 | + DatasetManager.getDatasetsListItemButtons().should('have.length', 4); |
140 | 160 | DatasetManager.startDatasetCreation(); |
141 | 161 | DatasetManager.setNewDatasetName(datasetName); |
142 | 162 | datasetTags.forEach((tag) => DatasetManager.addNewDatasetTag(tag)); |
@@ -251,14 +271,16 @@ describe('Dataset delete', () => { |
251 | 271 | it('can delete all scenarios from the list and display noDatasets placeholder', () => { |
252 | 272 | DatasetManager.ignoreDatasetTwingraphQueries(); |
253 | 273 | DatasetManager.switchToDatasetManagerView(); |
254 | | - DatasetManager.getDatasetsListItemButtons().should('have.length', 2); |
| 274 | + DatasetManager.getDatasetsListItemButtons().should('have.length', 4); |
255 | 275 | DatasetManager.getDatasetDeleteButton(DATASETS[0].id).click(); |
256 | 276 | DatasetManager.getDeleteDatasetDialog().should('be.visible'); |
257 | 277 | DatasetManager.getDeleteDatasetDialogBody().contains(DATASETS[0].name); |
258 | 278 | DatasetManager.closeDeleteDatasetDialog(); |
259 | 279 | DatasetManager.deleteDataset(DATASETS[0].id, DATASETS[0].name); |
260 | | - DatasetManager.getDatasetsListItemButtons().should('have.length', 1); |
| 280 | + DatasetManager.getDatasetsListItemButtons().should('have.length', 3); |
261 | 281 | DatasetManager.deleteDataset(DATASETS[1].id, DATASETS[1].name); |
| 282 | + DatasetManager.deleteDataset(DATASETS[3].id, DATASETS[3].name); |
| 283 | + DatasetManager.deleteDataset(DATASETS[4].id, DATASETS[4].name); |
262 | 284 | DatasetManager.getNoDatasetsPlaceholder().should('be.visible'); |
263 | 285 | DatasetManager.getNoDatasetsPlaceholderUserSubtitle().should('not.exist'); // Default role not set to "user" |
264 | 286 | }); |
|
0 commit comments