-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PMM-13205 line_count tests * PMM-13205 rename line_count tests to be executed at the end * PMM-13205 tweak line_count tests to be executed as part of FB
- Loading branch information
1 parent
5cb1084
commit 31e12ec
Showing
3 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const { codeceptjsConfig } = inject(); | ||
const assert = require('assert'); | ||
|
||
Feature('Logs tests'); | ||
|
||
const filename = 'logs.zip'; | ||
const fileNameToCheck = 'pmm-managed.log'; | ||
const baseUrl = codeceptjsConfig.config.helpers.Playwright.url; | ||
|
||
BeforeSuite(async ({ locationsAPI }) => { | ||
// Simple request to generate 51k lines in logs | ||
for (let i = 0; i < 10000; i++) { | ||
await locationsAPI.getLocationsList(); | ||
} | ||
}); | ||
|
||
// @settings-fb tag added in order to execute these tests on FB | ||
|
||
Scenario('Verify no line_count parameter when downloading logs @settings-fb', async ({ I }) => { | ||
const outputPath = await I.downloadZipFile(`${baseUrl}/logs.zip`, filename); | ||
const actualLineCount = I.getFileLineCount(outputPath, fileNameToCheck); | ||
|
||
assert.ok(actualLineCount === 50001, `File ${fileNameToCheck} has ${actualLineCount} lines, but expected 50001`); | ||
}); | ||
|
||
Scenario('Verify line_count=10 parameter when downloading logs @settings-fb', async ({ I }) => { | ||
const outputPath = await I.downloadZipFile(`${baseUrl}/logs.zip?line-count=10`, filename); | ||
const actualLineCount = I.getFileLineCount(outputPath, fileNameToCheck); | ||
|
||
assert.ok(actualLineCount === 11, `File ${fileNameToCheck} has ${actualLineCount} lines, but expected 11`); | ||
}); | ||
|
||
Scenario('Verify line_count=-1 parameter when downloading logs @settings-fb', async ({ I }) => { | ||
const outputPath = await I.downloadZipFile(`${baseUrl}/logs.zip?line-count=-1`, filename); | ||
const actualLineCount = I.getFileLineCount(outputPath, fileNameToCheck); | ||
|
||
assert.ok(actualLineCount > 50001, `File ${fileNameToCheck} has ${actualLineCount} lines, but expected more than 50001`); | ||
}); |