Skip to content

Commit 0388823

Browse files
author
ALENA NABOKA
committed
fix selectors, add new step to test
1 parent 9af7dc0 commit 0388823

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

tests/e2e/pageObjects/workbench-page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ export class WorkbenchPage {
5858
showSalesPerRegiomButton = Selector('[data-testid="preselect-Show all sales per region"]');
5959
queryCardNoModuleButton = Selector('[data-testid=query-card-no-module-button] a');
6060
rawModeBtn = Selector('[data-testid="btn-change-mode"]');
61+
closeEnablementPage = Selector('[data-testid=enablement-area__page-close]');
6162
//ICONS
6263
noCommandHistoryIcon = Selector('[data-testid=wb_no-results__icon]');
6364
//LINKS
6465
timeSeriesLink = Selector('[data-testid=internal-link-redis_for_time_series]');
6566
redisStackLinks = Selector('[data-testid=accordion-redis_stack] [data-testid^=internal-link]');
6667
tutorialsWorkingWithGraphLink = Selector('[data-testid=internal-link-working_with_graphs]');
6768
guidesWorkingWithGraphLink = Selector('[data-testid=internal-link-working-with-graphs]');
68-
guidesIntroductionGraphLink = Selector('[data-testid=accordion-button-graph] [data-testid=internal-link-introduction]');
69+
guidesIntroductionGraphLink = Selector('[data-testid=internal-link-introduction]');
6970
internalLinkWorkingWithHashes = Selector('[data-testid=internal-link-working-with-hashes]');
7071
vectorSimilitaritySearchButton = Selector('[data-testid=internal-link-vector_similarity_search]');
7172
//TEXT INPUTS (also referred to as 'Text fields')

tests/e2e/tests/critical-path/files-auto-update/enablement-area-autoupdate.e2e.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,21 @@ const workingDirectory = process.env.APP_FOLDER_ABSOLUTE_PATH
1515
|| (join(os.homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2'));
1616
if (fs.existsSync(workingDirectory)) {
1717
// Guides content
18-
// const guidesTimestampPath = `${workingDirectory}/guides/build.json`;
19-
// const guidesGraphIntroductionFilePath = `${workingDirectory}/guides/quick-guides/graph/introduction.md`;
20-
const guidesTimestampPath = 'E:\\Redis\\RedisInsight\\tests\\e2e\\.redisinsight-v2\\guides\\build.json';
21-
const guidesGraphIntroductionFilePath = 'E:\\Redis\\RedisInsight\\tests\\e2e\\.redisinsight-v2\\guides\\quick-guides\\graph\\introduction.md';
18+
const guidesTimestampPath = `${workingDirectory}/guides/build.json`;
19+
const guidesGraphIntroductionFilePath = `${workingDirectory}/guides/quick-guides/graph/introduction.md`;
2220

2321
// Tutorials content
24-
// const tutorialsTimestampPath = `${workingDirectory}/tutorials/build.json`;
25-
// const tutorialsTimeSeriesFilePath = `${workingDirectory}/guides/quick-guides/graph/introduction.md`;
26-
const tutorialsTimestampPath = 'E:\\Redis\\RedisInsight\\tests\\e2e\\.redisinsight-v2\\tutorials\\build.json';
27-
const tutorialsTimeSeriesFilePath = 'E:\\Redis\\RedisInsight\\tests\\e2e\\.redisinsight-v2\\tutorials\\redis_stack\\redis_for_time_series.md';
22+
const tutorialsTimestampPath = `${workingDirectory}/tutorials/build.json`;
23+
const tutorialsTimeSeriesFilePath = `${workingDirectory}/guides/quick-guides/graph/introduction.md`;
2824

29-
// Remove md files
30-
// fs.unlinkSync(guidesGraphIntroductionFilePath);
31-
// fs.unlinkSync(tutorialsTimeSeriesFilePath);
25+
// Remove md files from local folder. When desktop test will start, files will be updated from remote repository
26+
fs.unlinkSync(guidesGraphIntroductionFilePath);
27+
fs.unlinkSync(tutorialsTimeSeriesFilePath);
3228

3329
// Update timestamp for build files
3430
const guidesTimestampFile = editJsonFile(guidesTimestampPath);
3531
const tutorialsTimestampFile = editJsonFile(tutorialsTimestampPath);
3632

37-
console.log(`guide timestampBeforeUpdate: ${guidesTimestampFile.get('timestamp')}`);
38-
console.log(`tutorial timestampBeforeUpdate: ${tutorialsTimestampFile.get('timestamp')}`);
3933
const guidesNewTimestamp = guidesTimestampFile.get('timestamp') - 10;
4034
const tutorialNewTimestamp = tutorialsTimestampFile.get('timestamp') - 10;
4135

@@ -44,9 +38,6 @@ if (fs.existsSync(workingDirectory)) {
4438
tutorialsTimestampFile.set('timestamp', tutorialNewTimestamp);
4539
tutorialsTimestampFile.save();
4640

47-
console.log(`guide timestamp after file update: ${guidesTimestampFile.get('timestamp')}`);
48-
console.log(`tutorial timestamp after file update: ${tutorialsTimestampFile.get('timestamp')}`);
49-
5041
fixture `Automatically update information`
5142
.meta({ type: 'critical_path' })
5243
.page(commonUrl)
@@ -56,7 +47,7 @@ if (fs.existsSync(workingDirectory)) {
5647
.afterEach(async() => {
5748
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
5849
});
59-
test.only
50+
test
6051
.meta({ rte: rte.standalone, env: env.desktop })('Verify that user can see updated info in Enablement Area', async t => {
6152
// Create new file due to cache-ability
6253
const guidesTimestampFileNew = editJsonFile(guidesTimestampPath);
@@ -67,8 +58,9 @@ if (fs.existsSync(workingDirectory)) {
6758

6859
// Check Enablement area and validate that removed file is existed in Guides
6960
await t.click(workbenchPage.guidesGraphAccordion);
70-
await t.click(workbenchPage.guidesIntroductionGraphLink);
61+
await t.click(workbenchPage.guidesIntroductionGraphLink.nth(1));
7162
await t.expect(workbenchPage.enablementAreaEmptyContent.visible).notOk('Guides folder is not updated');
63+
await t.click(workbenchPage.closeEnablementPage);
7264

7365
// Check Enablement area and validate that removed file is existed in Tutorials
7466
await t.click(workbenchPage.redisStackTutorialsButton);

0 commit comments

Comments
 (0)