Skip to content

Commit ca0d4a0

Browse files
committed
refactor: update note assimilation process in recall tests
- Changed the assimilation process in feature files to use a consistent format for note assimilation. - Updated step definitions to reflect the new method for opening the assimilation page. - Adjusted scenarios to ensure clarity and consistency in note handling. Co-authored-by: terry <terry@odd-e.com>
1 parent 24ecbcf commit ca0d4a0

File tree

5 files changed

+34
-22
lines changed

5 files changed

+34
-22
lines changed

e2e_test/features/recall/browse_answer_and_notes_while_recalling.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Feature: Browse answers and notes while recalling
99
Given I am logged in as an existing user
1010
And I have a notebook with the head note "English" which skips review
1111
And there are some notes:
12-
| Title | Details | Skip Memory Tracking | Parent Title |
13-
| sedition | Sedition means incite violence | false | English |
14-
| sedation | Put to sleep is sedation | false | English |
15-
| medical | | true | English |
16-
And I am assimilating new note on day 1
12+
| Title | Details | Parent Title |
13+
| sedition | Sedition means incite violence | English |
14+
| sedation | Put to sleep is sedation | English |
15+
| medical | | English |
16+
And I am assimilating the note "sedition"
1717
And I assimilate with the option of remembering spelling
1818

1919
Scenario: View last answered question when the quiz answer was correct
20-
Given I assimilated one note "sedation" on day 1
20+
Given I assimilate the note "sedation"
2121
When I am recalling my note on day 2
2222
And I skip one question
2323
And I type my answer "sedition"
@@ -42,4 +42,4 @@ Feature: Browse answers and notes while recalling
4242
And I skip one question
4343
And I type my answer "sedition"
4444
When choose to remove the last memory tracker from recalls
45-
Then On day 100 I should have "0/1/1" note for assimilation and "1/2/2" for recall
45+
Then On day 100 I should have "0/2/2" note for assimilation and "1/2/2" for recall

e2e_test/features/recall/recall_quiz_ai_question.feature

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ Feature: Repetition Quiz
55
Given I am logged in as an existing user
66
And I have a notebook with the head note "English" which skips review
77
And there are some notes:
8-
| Title | Details | Skip Memory Tracking | Parent Title |
9-
| sedition | Sedition means incite violence | false | English |
10-
| sedation | Put to sleep is sedation | false | English |
11-
| medical | | true | English |
8+
| Title | Details | Parent Title |
9+
| sedition | Sedition means incite violence | English |
10+
| sedation | Put to sleep is sedation | English |
11+
| medical | | English |
1212

1313
@usingMockedOpenAiService
1414
Scenario: AI generated question - incorrect answer
15+
Given It's day 1, 8 hour
1516
Given OpenAI generates this question:
1617
| Question Stem | Correct Choice | Incorrect Choice 1 | Incorrect Choice 2 |
1718
| What is the meaning of sedition? | to incite violence | to sleep | Open Water Diver |
18-
And I assimilated one note "sedition" on day 1
19+
And I assimilate the note "sedition"
1920
When I am recalling my note on day 2
2021
Then I should be asked "What is the meaning of sedition?"
2122
When I choose answer "to sleep"
2223
Then I should see that my MCQ answer "to sleep" is incorrect
2324

2425
@usingMockedOpenAiService
2526
Scenario: AI generated question - correct answer
27+
Given It's day 1, 8 hour
2628
Given OpenAI generates this question:
2729
| Question Stem | Correct Choice | Incorrect Choice 1 | Incorrect Choice 2 |
2830
| What is the meaning of sedition? | to incite violence | to sleep | Open Water Diver |
29-
And I assimilated one note "sedition" on day 1
31+
And I assimilate the note "sedition"
3032
When I am recalling my note on day 2
3133
Then I should be asked "What is the meaning of sedition?"
3234
When I choose answer "to incite violence"

e2e_test/features/recall/recall_quiz_spelling_question.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Feature: Repetition Quiz
1111
| sedation | Put to sleep is sedation | English |
1212

1313
Scenario: Spelling quiz - incorrect answer
14-
Given I am assimilating new note on day 1
14+
Given I am assimilating the note "sedition"
1515
And I assimilate with the option of remembering spelling
1616
When I am recalling my note on day 2
1717
And I skip one question
@@ -20,7 +20,7 @@ Feature: Repetition Quiz
2020
Then I should see that my spelling answer "asdf" is incorrect
2121

2222
Scenario: Spelling quiz - correct answer
23-
Given I am assimilating new note on day 1
23+
Given I am assimilating the note "sedition"
2424
And I assimilate with the option of remembering spelling
2525
When I am recalling my note on day 2
2626
And I skip one question

e2e_test/start/pageObjects/noteMoreOptionsDialog.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,22 @@ const noteMoreOptionsDialog = () => {
8585
toolbarButton('Questions for the note').click()
8686
return questionListPage()
8787
},
88-
assimilateNote() {
88+
openAssimilationPage() {
8989
toolbarButton('Assimilate this note').click()
9090
cy.url().should('include', '/d/assimilate/')
9191
cy.pageIsNotLoading()
9292
// Wait for the assimilation page to load by checking for the "Keep for repetition" button
93-
cy.findByRole(
94-
'button',
95-
{ name: 'Keep for repetition' },
96-
{ timeout: 10000 }
97-
).should('be.visible')
93+
cy.findByRole('button', {
94+
name: 'Keep for repetition',
95+
timeout: 10000,
96+
})
97+
.scrollIntoView()
98+
.should('be.visible')
99+
},
100+
assimilateNote() {
101+
this.openAssimilationPage()
102+
cy.findByRole('button', { name: 'Keep for repetition' }).click()
103+
cy.pageIsNotLoading()
98104
},
99105
}
100106
}

e2e_test/step_definitions/recall.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Then('I am assimilating new note on day {int}', (day: number) => {
107107
When('I am assimilating the note {string}', (noteTitle: string) => {
108108
start.testability().backendTimeTravelTo(1, 8)
109109
cy.reload()
110-
start.jumpToNotePage(noteTitle).moreOptions().assimilateNote()
110+
start.jumpToNotePage(noteTitle).moreOptions().openAssimilationPage()
111111
})
112112

113113
When(
@@ -120,6 +120,10 @@ When(
120120
}
121121
)
122122

123+
Then('I assimilate the note {string}', (noteTitle: string) => {
124+
start.jumpToNotePage(noteTitle).moreOptions().assimilateNote()
125+
})
126+
123127
Then(
124128
'I set the level of {string} to be {int}',
125129
(noteTopology: string, level: number) => {

0 commit comments

Comments
 (0)