Skip to content

Add integration tests for collection estimation page #1115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mukeshk
Copy link
Contributor

@mukeshk mukeshk commented Aug 30, 2019

Fix #893

@mukeshk mukeshk requested a review from php-coder as a code owner August 30, 2019 07:08
@mystamps-bot
Copy link

mystamps-bot commented Aug 30, 2019

1 Warning
⚠️ danger check: pull request description doesn’t contain a link to original issue.
Consider adding a comment in the following format: Addressed to #XXX where XXX is an issue number

Generated by 🚫 Danger

@mukeshk
Copy link
Contributor Author

mukeshk commented Aug 30, 2019

I will check. the existing test case failed.

@php-coder
Copy link
Owner

Don't forget to also remove related TODO comment (see the original issue).

@mukeshk mukeshk force-pushed the gh893_test_collection_estimation_page branch 2 times, most recently from 6b3e5aa to ca3ca1e Compare August 30, 2019 17:05
Copy link
Owner

@php-coder php-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments.

@mukeshk mukeshk force-pushed the gh893_test_collection_estimation_page branch from ca3ca1e to 357233f Compare August 31, 2019 11:29
@mukeshk
Copy link
Contributor Author

mukeshk commented Aug 31, 2019

I am done with the comments.

Copy link
Owner

@php-coder php-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except a couple things that we missed. See my comments.

Also, could you, please, amend the first line of a commit message to be:

test(collection/estimation/logic.robot): add tests for collection estimation page.

@mukeshk mukeshk force-pushed the gh893_test_collection_estimation_page branch 2 times, most recently from 5356a51 to 6cf9d6a Compare September 1, 2019 09:54
Submit Form id=add-series-form
Go To ${SITE_URL}/collection/paid/estimation
Table Cell Should Contain collection-estimation 2 2 100.00 ${expectedCurrency}
Table Cell Should Contain collection-estimation 3 2 100.00 ${expectedCurrency}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we can't use Table Header Should Contain here? I mean, for "Total" it makes sense to use Table Header Should Contain while for the rows we can use Table Cell Should Contain or something similar.

Copy link
Contributor Author

@mukeshk mukeshk Sep 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I thought to remove the dependency on the Table Header. As we wanted to use Table Footer.
I can put it back. Yes, it's more communicative and expressive in terms of Table Header.

Select From List By Value id=paid-currency ${expectedCurrency}
Submit Form id=add-series-form
Go To ${SITE_URL}/collection/paid/estimation
Table Cell Should Contain collection-estimation 2 2 100.00 ${expectedCurrency}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below -- first argument is locator and we should use id=collection-estimation to make it more obvious for a reader.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to read what 2 and 2 means here. AFAIR we can use named arguments, like this:

Table Cell Should Contain    id=collection-estimation  row=2  col=2  text=100.00 ${expectedCurrency}

Could you check whether it works, please?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err.. forget my comments above. We need a better approach instead of using Table Cell Should Contain.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a better approach instead of using Table Cell Should Contain

While it's in a scope of this task, it's out of your budget, so I'm going to think about it later :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the table rows have id=series_x and column has series_x_price, where x = <series_id>.
We can have an assertion with xpath - identifying tr[@id=series_1]/td[@id=series_1_price] ... kind of. Just my thought, not sure if that's your concern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To summarise what needs to be done:

  1. fix "Table Cell Should Contain": add id= to locators, explicitly specify names of arguments (col/row/text)
  2. reduce an indentation between keywords and their parameters in the test cases with "Table Cell Should Contain"

That's it.

Thank you for your patience, Mukesh!

To summarise what needs to be done:

  1. fix "Table Cell Should Contain": add id= to locators, explicitly specify names of arguments (col/row/text)
  2. reduce an indentation between keywords and their parameters in the test cases with "Table Cell Should Contain"

That's it.

Thank you for your patience, Mukesh!

Thanks for your patience as well. :). Let's get it right as per your expecations !

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below -- first argument is locator and we should use id=collection-estimation to make it more obvious for a reader.

Next time, when I'll say something wrong, you may quote documentation to me:

Table related keywords, such as Table Should Contain, work differently. By default, when a table locator value is provided, it will search for a table with the specified id attribute.

:-)

Copy link
Owner

@php-coder php-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To summarise what needs to be done:

  1. fix "Table Cell Should Contain": add id= to locators, explicitly specify names of arguments (col/row/text)
  2. reduce an indentation between keywords and their parameters in the test cases with "Table Cell Should Contain"

That's it.

Thank you for your patience, Mukesh!

@mukeshk
Copy link
Contributor Author

mukeshk commented Sep 1, 2019

image

image

@mukeshk mukeshk force-pushed the gh893_test_collection_estimation_page branch from 6cf9d6a to 566a815 Compare September 1, 2019 17:05
@php-coder
Copy link
Owner

In the screenshot I see that you used comma (instead of 2 spaces) to separate arguments. But you've found it already :)

Copy link
Owner

@php-coder php-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you! 👍

@php-coder
Copy link
Owner

Whoops, couldn't merge because one item is still here:

Don't forget to also remove related TODO comment (see the original issue).

Let me know when you fix it, so I'll merge.

@mukeshk mukeshk force-pushed the gh893_test_collection_estimation_page branch from 566a815 to 2690f20 Compare September 2, 2019 04:09
@php-coder
Copy link
Owner

Excellent! Thank you!

@php-coder php-coder merged commit b828462 into php-coder:master Sep 2, 2019
Submit Form id=add-series-form
Go To ${SITE_URL}/collection/paid/estimation
Table Cell Should Contain collection-estimation row=2 column=2 text=100.00 ${expectedCurrency}
# TODO: use "Table Footer Should Contain" instead, when it will be fixed.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, I forgot that we shouldn't use TODO as 0pdd is also looking on it:

ERROR: src/test/robotframework/collection/estimation/logic.robot; puzzle at line #23; TODO found, but puzzle can't be parsed, most probably because TODO is not followed by a puzzle marker, as this page explains: https://github.com/yegor256/pdd#how-to-format

I'll fix it later.

@mukeshk mukeshk deleted the gh893_test_collection_estimation_page branch September 3, 2019 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add integration tests for collection estimation page
3 participants