Skip to content

Commit

Permalink
ChromeVox Tutorial Tests: Test practice area button visibility.
Browse files Browse the repository at this point in the history
Bug: 1127037
Change-Id: Icde8546beba54334b08a2a6af1ea49b3824a5ac2
AX-Relnotes: N/A
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2406542
Reviewed-by: Anastasia Helfinstein <anastasi@google.com>
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808506}
  • Loading branch information
akihiroota87 authored and Commit Bot committed Sep 18, 2020
1 parent 4f18019 commit 6d6f4de
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,52 @@ TEST_F('ChromeVoxTutorialTest', 'LessonSetTest', function() {
.expectSpeech('Text fields')
.replay();
});
});

// Tests that a static lesson does not show the 'Practice area' button.
TEST_F('ChromeVoxTutorialTest', 'NoPracticeAreaTest', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.simpleDoc, async function(root) {
const Panel = this.getPanel();
assertTrue(Panel.iTutorialEnabled_);
new PanelCommand(PanelCommandType.TUTORIAL).send();
await this.waitForTutorial();
const tutorial = Panel.iTutorial;
mockFeedback.expectSpeech('Choose your tutorial experience')
.call(doCmd('nextObject'))
.expectSpeech('New user', 'Button')
.call(doCmd('forceClickOnCurrentItem'))
.expectSpeech('New User Tutorial, 8 Lessons')
.call(() => {
tutorial.showLesson(0);
})
.expectSpeech('On, Off, and Stop', 'Heading 1')
.call(doCmd('nextButton'))
.expectSpeech('Next lesson')
.replay();
});
});

// Tests that an interactive lesson shows the 'Practice area' button.
TEST_F('ChromeVoxTutorialTest', 'HasPracticeAreaTest', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.simpleDoc, async function(root) {
const Panel = this.getPanel();
assertTrue(Panel.iTutorialEnabled_);
new PanelCommand(PanelCommandType.TUTORIAL).send();
await this.waitForTutorial();
const tutorial = Panel.iTutorial;
mockFeedback.expectSpeech('Choose your tutorial experience')
.call(doCmd('nextObject'))
.expectSpeech('New user', 'Button')
.call(doCmd('forceClickOnCurrentItem'))
.expectSpeech('New User Tutorial, 8 Lessons')
.call(() => {
tutorial.showLesson(2);
})
.expectSpeech('Basic Navigation', 'Heading 1')
.call(doCmd('nextButton'))
.expectSpeech('Practice Area')
.replay();
});
});

0 comments on commit 6d6f4de

Please sign in to comment.