-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Console output test: loop with short pauses (#4882)
Test for #4848 Also, retries globally turned on for smoke tests with "double screenshots and traces" as relevent. ### QA Notes All smoke tests pass.
- Loading branch information
1 parent
78557c8
commit 34b5c57
Showing
5 changed files
with
63 additions
and
5 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
51 changes: 51 additions & 0 deletions
51
test/smoke/src/areas/positron/console/consoleOutput.test.ts
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,51 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (C) 2024 Posit Software, PBC. All rights reserved. | ||
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
|
||
import { Application, PositronRFixtures } from '../../../../../automation'; | ||
import { setupAndStartApp } from '../../../positronUtils'; | ||
|
||
describe('Console Output', () => { | ||
setupAndStartApp(); | ||
|
||
describe('Console Output - R', () => { | ||
before(async function () { | ||
await PositronRFixtures.SetupFixtures(this.app as Application); | ||
}); | ||
|
||
it('R - Console output in a loop with short pauses [C885225]', async function () { | ||
const app = this.app as Application; | ||
|
||
const code = `tokens <- c( | ||
"", | ||
"Why", | ||
" do", | ||
" programmers", | ||
" prefer", | ||
" dark", | ||
" mode", | ||
"?\n\n", | ||
"Because", | ||
" light", | ||
" attracts", | ||
" bugs", | ||
"!" | ||
) | ||
for(token in tokens) { | ||
cat(token) | ||
Sys.sleep(0.01) | ||
}`; | ||
|
||
await app.workbench.positronConsole.pasteCodeToConsole(code); | ||
|
||
await app.workbench.positronConsole.sendEnterKey(); | ||
|
||
await app.workbench.positronConsole.waitForConsoleContents((contents) => contents.some((line) => line.includes('Why do programmers prefer dark mode'))); | ||
await app.workbench.positronConsole.waitForConsoleContents((contents) => contents.some((line) => line.includes('Because light attracts bugs!'))); | ||
|
||
}); | ||
}); | ||
}); |
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