Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix e2e

sytolk4519f109eedb
diff --git a/src/renderer/perspectives/grid/components/GridCell.tsx b/src/renderer/perspectives/grid/components/GridCell.tsx
index 23fe21b75..1dce8751c 100644
--- a/src/renderer/perspectives/grid/components/GridCell.tsx
+++ b/src/renderer/perspectives/grid/components/GridCell.tsx
@@ -445,6 +445,7 @@ function GridCell(props: Props) {
</Typography>
<Typography
title={description}
+ data-tid="gridCellDescription"
variant="caption"
display="block"
gutterBottom
diff --git a/src/renderer/perspectives/list/components/RowCell.tsx b/src/renderer/perspectives/list/components/RowCell.tsx
index ad55d50bc..1559023f1 100644
--- a/src/renderer/perspectives/list/components/RowCell.tsx
+++ b/src/renderer/perspectives/list/components/RowCell.tsx
@@ -441,6 +441,7 @@ function RowCell(props: Props) {
{entryTitle}
</Typography>
<Typography
+ data-tid="gridCellDescription"
style={{
color: 'gray',
}}
diff --git a/tests/e2e/general.helpers.js b/tests/e2e/general.helpers.js
index b25fcf289..317b24204 100644
--- a/tests/e2e/general.helpers.js
+++ b/tests/e2e/general.helpers.js
@@ -348,6 +348,18 @@ export async function expectAudioPlay() {
.toBe(true);
}
+export async function expectAllFileSelected(isSelected = true) {
+ let filesList = await global.client.$$(selectorFile);
+ for (let i = 0; i < filesList.length; i++) {
+ let file = await filesList[i].$('div');
+ file = await file.$('div');
+ const style = await file.getAttribute('style');
+ const selected =
+ style.indexOf('rgb(29') !== -1 && style.indexOf('transparent') === -1;
+ expect(selected).toBe(isSelected);
+ }
+}
+
export async function expectElementSelected(
selector,
isSelected = true,
diff --git a/tests/e2e/perspective-grid.pw.e2e.js b/tests/e2e/perspective-grid.pw.e2e.js
index 23c6f0736..206a13dab 100644
--- a/tests/e2e/perspective-grid.pw.e2e.js
+++ b/tests/e2e/perspective-grid.pw.e2e.js
@@ -11,7 +11,9 @@ import {
} from './location.helpers';
import {
clickOn,
+ expectAllFileSelected,
expectElementExist,
+ expectElementSelected,
expectMetaFilesExist,
getGridCellClass,
getGridFileName,
@@ -78,30 +80,10 @@ test.describe('TST50 - Perspective Grid', () => {
});
test('TST5004 - Select-deselect all files [web,minio,electron]', async () => {
- const classNotSelected = await getGridCellClass(0);
- await selectAllFiles(); // classNotSelected);
- const classSelected = await getGridCellClass(0);
-
- expect(classNotSelected).not.toBe(classSelected);
-
- let filesList = await global.client.$$(selectorFile);
- for (let i = 0; i < filesList.length; i++) {
- let file = await filesList[i].$('div');
- file = await file.$('div');
- file = await file.$('div');
- const style = await file.getAttribute('class');
- expect(style).toBe(classSelected);
- }
- //deselect
- /*await selectAllFiles();
- filesList = await global.client.$$(selectorFile);
- for (let i = 0; i < filesList.length; i++) {
- let file = await filesList[i].$('div');
- file = await file.$('div');
- file = await file.$('div');
- const style = await file.getAttribute('class');
- expect(style).toBe(classNotSelected);
- }*/
+ await selectAllFiles();
+ await expectAllFileSelected(true);
+ await selectAllFiles();
+ await expectAllFileSelected(false);
});
// This scenario includes "Add tags" && "Remove tags" to be fulfilled