Open DavertMik opened 1 year ago
π΄ FAILED π΄ | |
---|---|
Tests | βοΈ 710 tests run |
Summary | π΄ 13 failed; π’ 697 passed; π‘ 0 skipped |
Duration | π 1414.68ms |
Testomat.io Report | π Run #778af5f2 |
Expected nil to be truthy.
Failure: test_analytics_is_not_accessible_without_Enterprise_subscription(Minitest::Result) /home/davert/projects/testomatio/backend/test/integration/api/analytics_controller_test.rb:20: Expected nil to be truthy.
################[ Failure ]################ 17 | get api_analytics_counters_path(project) 18 | echo @response.body 19 | json = JSON.parse @response.body, symbolize_names: true 20 > assert json[:error] 21 | end 22 | 23 | test 'load counters' do
---
#### π΄ Api::BranchesControllerTest: **branches is not accessible without Enterprise subscription**
> Expected nil to be truthy.
```diff
Failure:
test_branches_is_not_accessible_without_Enterprise_subscription(Minitest::Result)
/home/davert/projects/testomatio/backend/test/integration/api/branches_controller_test.rb:18:
Expected nil to be truthy.
################[ Failure ]################
15 | get api_branches_path(project)
16 | echo @response.body
17 | json = JSON.parse @response.body, symbolize_names: true
18 > assert json[:error]
19 | end
20 |
21 | test 'should return all branches' do
Exceptions::LimitReachedError expected but nothing was raised.
Failure: test_can_not_invite_not_active_user(Minitest::Result) /home/davert/projects/testomatio/backend/test/models/company_test.rb:92: Exceptions::LimitReachedError expected but nothing was raised.
################[ Failure ]################ 89 | 90 | member2 = User.create name: 'dummy member', password: 'password', password_confirmation: 'password', email: 'member@user.com' 91 | 92 > assert_raises(Exceptions::LimitReachedError) { @company.can_invite! member2 } 93 | end 94 | 95 | test 'can invite if trial is enabled' do
---
#### π΄ CompanyTest: **notify if custom subscription set**
> Expected: 2...
```diff
Failure:
test_should_notify_if_custom_subscription_set(Minitest::Result)
/home/davert/projects/testomatio/backend/test/models/company_test.rb:125:
Expected: 2
Actual: 4
################[ Failure ]################
122 | @company.save
123 |
124 | echo @company.active_users.pluck(:name)
125 > _(@company.active_users.count).must_equal 2
126 | echo @company.removed_users.pluck(:name)
127 | _(@company.removed_users.count).must_equal 2
128 |
Exceptions::LimitReachedError expected but nothing was raised.
Failure: test_can_not_invite_new_user(Minitest::Result) /home/davert/projects/testomatio/backend/test/models/company_test.rb:74: Exceptions::LimitReachedError expected but nothing was raised.
################[ Failure ]################ 71 | test 'can not invite new user' do 72 | @company.users_limit = 0 73 | 74 > assert_raises(Exceptions::LimitReachedError) { @company.can_invite! } 75 | end 76 | 77 | test 'can invite active user' do
---
#### π΄ Dispatch::ReportControllerTest: **add test to report**
> Expected: 3...
```diff
Failure:
test_add_test_to_report(Minitest::Result)
/home/davert/projects/testomatio/backend/test/controllers/dispatch/report_controller_test.rb:91:
Expected: 3
Actual: 4
################[ Failure ]################
88 | }
89 | assert_response :bad_request
90 | echo @response.body
91 > _(run.testruns.count).must_equal 3
92 | end
93 |
94 | test 'create automated report with test runs' do
Expected false to be truthy.
Failure: test_should_sign_in_registering_user(Minitest::Result) /home/davert/projects/testomatio/backend/test/integration/oauth_test.rb:235: Expected false to be truthy.
################[ Failure ]################ 232 | _(user.name).must_equal 'davert' 233 | assert user.avatar.attached? 234 | assert user.isactive? 235 > assert TrialService.new(user).active? 236 | assert flash[:success] 237 | (flash[:success]).mustinclude 'Welcome to Testomat.io' 238 | (flash[:success]).must_include 'trial'
---
#### π΄ ProjectTest: **it should not have subscription if user have no trial**
> Expected #<Subscription id: nil, product_id: nil, title: "enterprise", description: nil, price_monthly: nil, price_yearly: nil, features: nil, users_limit: nil, created_at: nil, updated_at: nil, stripe_monthly_product_id: nil, stripe_yearly_product_id: nil> to be nil or false
```diff
Failure:
test_it_should_not_have_subscription_if_user_have_no_trial(Minitest::Result)
/home/davert/projects/testomatio/backend/test/models/project_test.rb:17:
Expected #<Subscription id: nil, product_id: nil, title: "enterprise", description: nil, price_monthly: nil, price_yearly: nil, features: nil, users_limit: nil, created_at: nil, updated_at: nil, stripe_monthly_product_id: nil, stripe_yearly_product_id: nil> to be nil or false
################[ Failure ]################
14 | test 'it should not have subscription if user have no trial' do
15 | p.user = developer_record
16 | p.save
17 > assert_not p.subscription
18 | end
19 |
20 | test 'it should have subscription if user has trial' do
Expected #<Subscription id: nil, product_id: nil, title: "enterprise", description: nil, price_monthly: nil, price_yearly: nil, features: nil, users_limit: nil, created_at: nil, updated_at: nil, stripe_monthly_product_id: nil, stripe_yearly_product_id: nil> to be nil or false
Failure: test_it_should_not_have_any_subscription(Minitest::Result) /home/davert/projects/testomatio/backend/test/models/project_test.rb:11: Expected #<Subscription id: nil, product_id: nil, title: "enterprise", description: nil, price_monthly: nil, price_yearly: nil, features: nil, users_limit: nil, created_at: nil, updated_at: nil, stripe_monthly_product_id: nil, stripe_yearly_product_id: nil> to be nil or false
################[ Failure ]################ 8 | let(:p) { Project.create title: 'test1' } 9 | 10 | test 'it should not have any subscription' do 11 > assert_not p.subscription 12 | end 13 | 14 | test 'it should not have subscription if user have no trial' do
---
#### π΄ ProjectTest: **it should have subscription if user has trial**
> Expected nil to be truthy.
```diff
Failure:
test_it_should_have_subscription_if_user_has_trial(Minitest::Result)
/home/davert/projects/testomatio/backend/test/models/project_test.rb:25:
Expected nil to be truthy.
################[ Failure ]################
22 | p.save
23 | TrialService.new(p.user).start
24 | assert p.subscription
25 > assert p.subscription.trial
26 | end
27 |
28 | test 'it should unlock project of same user after deleting one' do
--- expected...
Failure: test_it_should_have_subscription_from_a_company(Minitest::Result) /home/davert/projects/testomatio/backend/test/models/project_test.rb:41: --- expected +++ actual @@ -1 +1 @@ -#<Subscription id: nil, product_id: nil, title: "enterprise", description: nil, price_monthly: nil, price_yearly: nil, features: nil, users_limit: nil, created_at: nil, updated_at: nil, stripe_monthly_product_id: nil, stripe_yearly_product_id: nil> +#<Subscription id: 1, product_id: nil, title: "Professional", description: "For small and medium-sized businesses", price_monthly: 5, price_yearly: 10, features: ["Unlimited users", "Unlimited projects", "Test runs", "Notifications", "CI integrations"], users_limit: nil, created_at: "2022-12-01 00:56:25.535480000 +0000", updated_at: "2022-12-01 00:56:25.535480000 +0000", stripe_monthly_product_id: "price_1InguIG1zSfCnE1yU9yFnexH", stripe_yearly_product_id: "price_1InguIG1zSfCnE1yGrw9rRyn">
################[ Failure ]################ 38 | p.user = developer_record 39 | p.save 40 | assert p.subscription 41 > assert_equal p.subscription, Subscription.first 42 | end 43 | 44 | test 'should not fail if lang is nil' do
---
#### π΄ SubscriptionServiceTest: **users over limit are removed on unsubscribe**
> Expected: 1...
```diff
Failure:
test_users_over_limit_are_removed_on_unsubscribe(Minitest::Result)
/home/davert/projects/testomatio/backend/test/services/subscription_service_test.rb:106:
Expected: 1
Actual: 2
################[ Failure ]################
103 |
104 | base_subscription_service.deactivate!
105 |
106 > assert_equal 1, company.active_users.count
107 | assert_equal company.owner.id, company.active_users.first.id
108 | end
109 |
Expected false to be truthy.
Failure: test_should_deactivate_users_and_reinvite(Minitest::Result) /home/davert/projects/testomatio/backend/test/services/subscription_service_test.rb:73: Expected false to be truthy.
################[ Failure ]################ 70 | company.deactivate_extra_users 71 | echo company.activeusers.pluck(:email) 72 | 73 > assert user2.permissions.count.zero? 74 | 75 | (company.active_users.length).must_equal 3 76 |
---
### π’ Slowest Tests
* ImportSpreadsheetServiceTest: **import testrail example project** (225.28ms)
* ImportSpreadsheetServiceTest: **import testrail project with steps duplicated column, merged to one and splitted rows** (153.20ms)
* ImportSpreadsheetServiceTest: **import zephyr project as bdd** (140.43ms)
* ImportSpreadsheetServiceTest: **import zephir X l s project** (139.49ms)
* ImportSpreadsheetServiceTest: **import zip file with attachments** (63.05ms)
π΄ FAILED π΄ | |
---|---|
Tests | βοΈ 32 tests run |
Summary | π΄ 12 failed; π’ 9 passed; π‘ 0 skipped |
Duration | π 9373.00ms |
Testomat.io Report | π Run #d9d385fb |
[Todo with umlauts Àâü,is in list]
Expected "Todo with umlauts " but got "Todo with umlauts "
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1176ms) I refresh page (665ms) I execute script () => sessionStorage.clear() (4ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (35ms) When I enter {Todo Text} TodosPage: enterTodo "Todo with umlauts Àâü" I fill field ".new-todo", "Todo with umlauts Àâü" (342ms) I press key "Enter" (48ms) Then I see {Result} TodosPage: seeNthTodoEquals 1, "Todo with umlauts Àâü" I grab text from ".todo-list li" (10ms)
################[ Failure ]################
Expected "Todo with umlauts Àâü" but got "
Todo with umlauts Àâü
"
true
84 | let todos = await I.grabTextFrom('.todo-list li') 85 | if (typeof todos === 'string') { 86 | todos = [todos] 87 | } 88 |
89 | assert(todos[nthTodo - 1] === 1,
Expected "${todo}" but got "${todos[nthTodo - 1]}"
) 90 | return todos 91 | }, 92 | 93 | seeNumberOfTodos(numberOfTodos) { 94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/d1661079-2dca-4b20-a83b-1dc75d53c6f1-Todos_containing_weird_characters.failed.png)
[Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo,is in list]
Expected "Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo" but got "Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo"
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1134ms) I refresh page (655ms) I execute script () => sessionStorage.clear() (5ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (40ms) When I enter {Todo Text} TodosPage: enterTodo "Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo" I fill field ".new-todo", "Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo" (2088ms) I press key "Enter" (32ms) Then I see {Result} TodosPage: seeNthTodoEquals 1, "Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo" I grab text from ".todo-list li" (9ms)
################[ Failure ]################
Expected "Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo" but got "
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo
"
true
84 | let todos = await I.grabTextFrom('.todo-list li') 85 | if (typeof todos === 'string') { 86 | todos = [todos] 87 | } 88 |
89 | assert(todos[nthTodo - 1] === 1,
Expected "${todo}" but got "${todos[nthTodo - 1]}"
) 90 | return todos 91 | }, 92 | 93 | seeNumberOfTodos(numberOfTodos) { 94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/f4f6caf0-51a6-4e21-a3f3-b82aa4e5da31-Todos_containing_weird_characters.failed.png)
[Todo with html code <script>alert("hello")</script>,is in list]
Expected "Todo with html code " but got "Todo with html code "
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1170ms) I refresh page (645ms) I execute script () => sessionStorage.clear() (4ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (30ms) When I enter {Todo Text} TodosPage: enterTodo "Todo with html code <script>alert("hello")</script>" I fill field ".new-todo", "Todo with html code <script>alert("hello")</script>" (756ms) I press key "Enter" (41ms) Then I see {Result} TodosPage: seeNthTodoEquals 1, "Todo with html code <script>alert("hello")</script>" I grab text from ".todo-list li" (7ms)
################[ Failure ]################
Expected "Todo with html code " but got "
Todo with html code <script>alert("hello")</script>
"
true
84 | let todos = await I.grabTextFrom('.todo-list li') 85 | if (typeof todos === 'string') { 86 | todos = [todos] 87 | } 88 |
89 | assert(todos[nthTodo - 1] === 1,
Expected "${todo}" but got "${todos[nthTodo - 1]}"
) 90 | return todos 91 | }, 92 | 93 | seeNumberOfTodos(numberOfTodos) { 94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/9130a9cc-2aa3-4a2c-a724-9acddd4ede2f-Todos_containing_weird_characters.failed.png)
Expected "Todo with lots of whitespace around" but got "Todo with lots of whitespace around"
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1087ms) I refresh page (650ms) I execute script () => sessionStorage.clear() (4ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (44ms) Given I have an empty todo list When I enter a todo with whitespace around the text TodosPage: enterTodo " Todo with lots of whitespace around " I fill field ".new-todo", " Todo with lots of whitespace around " (738ms) I press key "Enter" (26ms) Then I see the trimmed text of the todo in the list TodosPage: seeNthTodoEquals 1, "Todo with lots of whitespace around" I grab text from ".todo-list li" (9ms)
################[ Failure ]################
Expected "Todo with lots of whitespace around" but got "
Todo with lots of whitespace around
"
true
84 | let todos = await I.grabTextFrom('.todo-list li') 85 | if (typeof todos === 'string') { 86 | todos = [todos] 87 | } 88 |
89 | assert(todos[nthTodo - 1] === 1,
Expected "${todo}" but got "${todos[nthTodo - 1]}"
) 90 | return todos 91 | }, 92 | 93 | seeNumberOfTodos(numberOfTodos) { 94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/a364fe94-3a78-46ee-a73a-7877ee7e3d88-Text_input_should_be_trimmed.failed.png)
Expected "first" but got "first"
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1418ms) I refresh page (665ms) I execute script () => sessionStorage.clear() (3ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (28ms) Given I added some todos TodosPage: enterTodo "last" I fill field ".new-todo", "first" (103ms) I press key "Enter" (32ms) I fill field ".new-todo", "second" (116ms) I press key "Enter" (10ms) I fill field ".new-todo", "last" (78ms) I press key "Enter" (8ms) When I look at my todo list Then I see the todos in the order in which I added them TodosPage: seeNthTodoEquals 1, "first" I grab text from ".todo-list li" (11ms)
################[ Failure ]################
Expected "first" but got "
first
"
true
84 | let todos = await I.grabTextFrom('.todo-list li') 85 | if (typeof todos === 'string') { 86 | todos = [todos] 87 | } 88 |
89 | assert(todos[nthTodo - 1] === 1,
Expected "${todo}" but got "${todos[nthTodo - 1]}"
) 90 | return todos 91 | }, 92 | 93 | seeNumberOfTodos(numberOfTodos) { 94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/a8aa9f52-94f7-478f-93dd-7b07ab6a70a7-New_todos_should_be_added_to_the_bottom_of_the_list.failed.png)
I.createUserAndLogIn is not a function
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1071ms) I refresh page (661ms) I execute script () => sessionStorage.clear() (4ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (43ms) TodosPage: enterTodo "baz" I fill field ".new-todo", "foo" (86ms) I press key "Enter" (45ms) I fill field ".new-todo", "bar" (65ms) I press key "Enter" (10ms) I fill field ".new-todo", "baz" (76ms) I press key "Enter" (7ms)
################[ Failure ]################
I.createUserAndLogIn is not a function 7 | TodosPage.enterTodo('bar') 8 | TodosPage.enterTodo('baz') 9 |}) 10 | 11 |Scenario('Unapproved user cant chat with unapproved user', async ({I}) => {
12 | I.createUserAndLogIn(); 13 | const username = globalConf.users.getCurrentUser().username; 14 | await I.getUserId(username); 15 | 16 | I.logOut(); 17 |
at Test.
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/71c6a54c-f481-4de4-b160-ccfb6de326b2-Unapproved_user_cant_chat_with_unapproved_user.failed.png)
---
#### π΄ Edit/Delete Todos @step-06: **Edited todo is saved on blur**
> Expected "boom" but got "boom"
```diff
TodosPage: goto
I am on page "http://todomvc.com/examples/angularjs/#/" (1199ms)
I refresh page (632ms)
I execute script () => sessionStorage.clear() (4ms)
I execute script () => console.error('Boom!') (2ms)
I wait for visible ".new-todo" (35ms)
TodosPage: enterTodo "baz"
I fill field ".new-todo", "foo" (75ms)
I press key "Enter" (51ms)
I fill field ".new-todo", "bar" (62ms)
I press key "Enter" (7ms)
I fill field ".new-todo", "baz" (67ms)
I press key "Enter" (8ms)
Given I have some todos
When I edit the first todo
TodosPage: editNthTodo 1, "boom"
I double click 1 todo item (63ms)
I fill field 1nth todo input, "boom" (84ms)
I press key "Enter" (8ms)
Then I see that the todo text has been changed
TodosPage: seeNthTodoEquals 1, "boom"
I grab text from ".todo-list li" (12ms)
################[ Failure ]################
Expected "boom" but got "
boom
"
+ expected - actual
- false
+ true
84 | let todos = await I.grabTextFrom('.todo-list li')
85 | if (typeof todos === 'string') {
86 | todos = [todos]
87 | }
88 |
> 89 | assert(todos[nthTodo - 1] === 1, `Expected "${todo}" but got "${todos[nthTodo - 1]}"`)
90 | return todos
91 | },
92 |
93 | seeNumberOfTodos(numberOfTodos) {
94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.<anonymous> (todomvc-tests/edit-todos_test.js:32:5)
Cannot read property 'page' of undefined
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1115ms) I refresh page (674ms) I execute script () => sessionStorage.clear() (4ms) I execute script () => console.error('Boom!') (3ms) I wait for visible ".new-todo" (27ms) TodosPage: enterTodo "baz" I fill field ".new-todo", "foo" (62ms) I press key "Enter" (32ms) I fill field ".new-todo", "bar" (65ms) I press key "Enter" (9ms) I fill field ".new-todo", "baz" (66ms) I press key "Enter" (7ms) Given I have some todos When I delete the first todo TodosPage: deleteNthTodo 1 I hover ".todo-list li:nth-child(1)" (1ms)
################[ Failure ]################
Cannot read property 'page' of undefined 70 | I.pressKey('Enter') 71 | }, 72 | 73 | deleteNthTodo(nthTodo) { 74 | // Use a custom helper function to hover over an todo item
75 | I.hover(
.todo-list li:nth-child(${nthTodo})
) 76 | I.click(nthTTodoDeleteButton(nthTodo)) 77 | }, 78 | 79 | refresh() { 80 | I.refreshPage()
at Object.deleteNthTodo (./todomvc-tests/pages/todos.page.js:75:11)
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/69e02979-50cd-4685-b84d-97d1f6b0ab63-Delete_todos.failed.png)
---
#### π΄ Mark as completed/not completed @step-06: **Mark all todos as completed**
> page.$$: Unexpected token "" while parsing selector "label[for="toggle-all""
```diff
TodosPage: goto
I am on page "http://todomvc.com/examples/angularjs/#/" (1081ms)
I refresh page (717ms)
I execute script () => sessionStorage.clear() (3ms)
I execute script () => console.error('Boom!') (4ms)
I wait for visible ".new-todo" (31ms)
TodosPage: enterTodo "baz"
I fill field ".new-todo", "foo" (80ms)
I press key "Enter" (30ms)
I fill field ".new-todo", "bar" (83ms)
I press key "Enter" (12ms)
I fill field ".new-todo", "baz" (78ms)
I press key "Enter" (12ms)
Given I have some todos
When I mark them all as completed
TodosPage: markAllAsCompleted
I click "label[for="toggle-all"" (25ms)
################[ Failure ]################
page.$$: Unexpected token "" while parsing selector "label[for="toggle-all""
43 | assert(classNames.indexOf('completed') >= 0, 'Expected todo to be marked as completed')
44 | I.click(nthTodoCheckbox(nthTodo))
45 | },
46 |
47 | markAllAsCompleted() {
> 48 | I.click('label[for="toggle-all"')
49 | },
50 |
51 | clearCompleted() {
52 | I.click('button.clear-completed')
53 | },
at Object.markAllAsCompleted (./todomvc-tests/pages/todos.page.js:48:11)
page.$$: Unexpected token "" while parsing selector "label[for="toggle-all""
TodosPage: goto I am on page "http://todomvc.com/examples/angularjs/#/" (1201ms) I refresh page (666ms) I execute script () => sessionStorage.clear() (5ms) I execute script () => console.error('Boom!') (4ms) I wait for visible ".new-todo" (45ms) TodosPage: enterTodo "baz" I fill field ".new-todo", "foo" (91ms) I press key "Enter" (48ms) I fill field ".new-todo", "bar" (76ms) I press key "Enter" (11ms) I fill field ".new-todo", "baz" (76ms) I press key "Enter" (9ms) Given I have some completed todos TodosPage: markAllAsCompleted I click "label[for="toggle-all"" (26ms)
################[ Failure ]################
page.$$: Unexpected token "" while parsing selector "label[for="toggle-all"" 43 | assert(classNames.indexOf('completed') >= 0, 'Expected todo to be marked as completed') 44 | I.click(nthTodoCheckbox(nthTodo)) 45 | }, 46 | 47 | markAllAsCompleted() {
48 | I.click('label[for="toggle-all"') 49 | }, 50 | 51 | clearCompleted() { 52 | I.click('button.clear-completed') 53 | },
at Object.markAllAsCompleted (./todomvc-tests/pages/todos.page.js:48:11)
![](https://testomatio-artifacts.ams3.digitaloceanspaces.com/undefined/84df6c2f-cc56-4f17-aeee-ea12cc606c6e-Clear_completed_todos.failed.png)
---
#### π΄ Persist Todos: **Todos survive a page refresh @step-06**
> Expected "foo" but got "foo"
```diff
Given I have some todos
I clear cookie (2ms)
TodosPage: goto
I am on page "http://todomvc.com/examples/angularjs/#/" (1201ms)
I refresh page (627ms)
I execute script () => sessionStorage.clear() (5ms)
I execute script () => console.error('Boom!') (4ms)
I wait for visible ".new-todo" (34ms)
TodosPage: enterTodos [{"title":"foo","completed":false},{"title":"bar","completed":false},{"title":"baz","completed":false},{"title":"boom","completed":true}]
I execute script (todoItems) => {
localStorage.setItem('todos-angularjs', JSON.stringify(todoItems));
}, [{"title":"foo","completed":false},{"title":"bar","completed":false},{"title":"baz","completed":false},{"title":"boom","completed":true}] (8ms)
TodosPage: refresh
I refresh page (667ms)
I save screenshot "initial-todos.png" (117ms)
And I marked the first as completed
TodosPage: markNthAsCompleted 1
I grab attribute from 1 todo item, "class" (29ms)
I click {xpath: .//div/input[ancestor::*[contains(concat(' ', normalize-space(./@class), ' '), ' todo-list ')]//li[count(preceding-sibling::*) = 0]]} (82ms)
When I refresh the page
TodosPage: refresh
I refresh page (632ms)
Then I still see the same todos
TodosPage: seeNumberOfTodos 4
I see number of visible elements ".todo-list li", 4 (40ms)
TodosPage: seeNthTodoEquals 1, "foo"
I grab text from ".todo-list li" (8ms)
################[ Failure ]################
Expected "foo" but got "
foo
"
+ expected - actual
- false
+ true
84 | let todos = await I.grabTextFrom('.todo-list li')
85 | if (typeof todos === 'string') {
86 | todos = [todos]
87 | }
88 |
> 89 | assert(todos[nthTodo - 1] === 1, `Expected "${todo}" but got "${todos[nthTodo - 1]}"`)
90 | return todos
91 | },
92 |
93 | seeNumberOfTodos(numberOfTodos) {
94 | I.seeNumberOfVisibleElements('.todo-list li', numberOfTodos)
at Object.seeNthTodoEquals (todomvc-tests/pages/todos.page.js:89:9)
at async Test.<anonymous> (todomvc-tests/persist-todos_test.js:27:3)
Text "some text" was not found on page after 5 secpage.waitForFunction: Timeout 5000ms exceeded.
I am on page "http://todomvc.com/examples/angularjs/#/" (1091ms) Given I already have some todos I wait for text "some text" (5004ms)
################[ Failure ]################
Text "some text" was not found on page after 5 sec page.waitForFunction: Timeout 5000ms exceeded. 2345 | } 2346 | } else { 2347 | waiter = contextObject.waitForFunction(text => document.body && document.body.innerText.indexOf(text) > -1, text, { timeout: waitTimeout }); 2348 | } 2349 | return waiter.catch((err) => {
2350 | throw new Error(
Text "${text}" was not found on page after ${waitTimeout / 1000} sec\n${err.message}
); 2351 | }); 2352 | } 2353 | 2354 | /* 2355 | Waits for a network request.
[Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong TooooooooooooooooooooooooooooooooooooooooDooooooooooooooo,is in list]
(2232.00ms)[Todo with html code <script>alert("hello")</script>,is in list]
(940.00ms)[Todo with umlauts Àâü,is in list]
(569.00ms)
das