Skip to content
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

chore: Cypress all selectors refactor #11134

Closed
wants to merge 12 commits into from

Conversation

adam-stasiak
Copy link
Contributor

@adam-stasiak adam-stasiak commented Oct 1, 2020

SUMMARY

This PR contains merged changes from outddated but reviewed branches. I resolved most of accuracy issues included in review notes. Not everywhere it was possible to add data-test selector to make some cypress steps more specific.

image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@adam-stasiak adam-stasiak changed the title [WIP] chore: Cypress all selectors refactor chore: Cypress all selectors refactor Oct 2, 2020
@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2020

Codecov Report

Merging #11134 into master will decrease coverage by 4.54%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11134      +/-   ##
==========================================
- Coverage   65.88%   61.33%   -4.55%     
==========================================
  Files         827      391     -436     
  Lines       39046    24483   -14563     
  Branches     3673        0    -3673     
==========================================
- Hits        25725    15017   -10708     
+ Misses      13214     9466    -3748     
+ Partials      107        0     -107     
Flag Coverage Δ
#cypress ?
#javascript ?
#python 61.33% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engine_specs/presto.py 81.42% <0.00%> (-0.65%) ⬇️
superset-frontend/src/utils/parseCookie.ts
...end/src/SqlLab/components/TemplateParamsEditor.jsx
superset-frontend/src/components/ErrorBoundary.jsx
...nd/src/dashboard/util/getDetailedComponentWidth.js
...dashboard/components/menu/MarkdownModeDropdown.jsx
superset-frontend/src/addSlice/index.tsx
superset-frontend/src/logger/actions/index.js
...src/dashboard/components/gridComponents/Header.jsx
superset-frontend/src/utils/errorMessages.js
... and 377 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6358a7f...f5bbf61. Read the comment docs.

@willbarrett
Copy link
Member

@adam-stasiak this PR is huge and hard to review. Could you break this down into multiple smaller PRs?

@adam-stasiak
Copy link
Contributor Author

@willbarrett I did this big PR because my partials were outdated and it was hard to rebase them when I was adding module by module.

I can split this by Cypress module fraction so split into PR for Dashboard, PR for Explore module, but I am afraid it would be hard to seperate changes in components. Is it ok to just make this smaller with cypress part not TSX?

@willbarrett
Copy link
Member

@rusackas do you have any suggestions here?

});

it('should work with multiple groupby and multiple metrics', () => {
it.only('should work with multiple groupby and multiple metrics', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe we want the .only here, right?

@@ -78,11 +78,6 @@ const StyledModal = styled(BaseModal)`
margin-left: 8px;
}
}

// styling for Tabs component
Copy link
Member

Choose a reason for hiding this comment

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

Curious if/how this is relevant to the PR... looks like it would be a visual change... is it something @kgabryje is aware of?

Copy link
Member

Choose a reason for hiding this comment

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

It looks like a rebasing mistake to me. Adam, can you please bring it back?

@@ -271,15 +276,16 @@ export default function TableCollection({
const columnCellProps = cell.column.cellProps || {};
return (
<td
className={cx('table-cell', {
data-test="row-cell"
className={cx('row-cell', {
Copy link
Member

Choose a reason for hiding this comment

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

The table-cell class removed here appears to have CSS styles that were applied to it. Is there a reason to cahge it?

@rusackas
Copy link
Member

rusackas commented Oct 7, 2020

@adam-stasiak this PR is huge and hard to review. Could you break this down into multiple smaller PRs?

I'm just slogging through it, a few files here and a few files there, making comments as I go. Looks like it needs a rebase currently, but I'll keep revisiting, and we can just shove it across the line.

@adam-stasiak
Copy link
Contributor Author

@adam-stasiak this PR is huge and hard to review. Could you break this down into multiple smaller PRs?

I'm just slogging through it, a few files here and a few files there, making comments as I go. Looks like it needs a rebase currently, but I'll keep revisiting, and we can just shove it across the line.

How would you split this? I would vote for PR for TSX changes and then PRs for cypress modules?

>
<span className={className} />
<span {...{ 'data-test': 'icon-button-span' }} className={className} />
Copy link
Member

Choose a reason for hiding this comment

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

Curious why the spread syntax here instead of the usual attribute.

<StyledHeader
id="slice-header"
className="clearfix panel-title-large"
ref
Copy link
Member

Choose a reason for hiding this comment

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

Why the 'ref' prop?

@@ -159,7 +159,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {

return (
<form onSubmit={onSubmit}>
<Modal.Header closeButton>
<Modal.Header data-test="edit-modal" closeButton>
Copy link
Member

Choose a reason for hiding this comment

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

Could be more specific (i.e. 'edit-properties-modal') if you can expect there to be more than one instance of modal in the code with data-test="edit-modal" - it just makes it easier to find the instance in the codebase.

<div style={{ margin: '5px 0' }}>
<Datetime
inputProps={{ 'data-test': 'date-from-input' }}
Copy link
Member

Choose a reason for hiding this comment

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

Hmm... I wonder if that babel extension will manage strip out data-test attributes added like this. ¯\_(ツ)_/¯

@@ -293,7 +293,10 @@ function DashboardList(props: DashboardListProps) {
className="action-button"
onClick={confirmDelete}
>
<Icon name="trash" />
<Icon
{...{ 'data-test': 'dashboard-list-trash-icon' }}
Copy link
Member

Choose a reason for hiding this comment

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

Wondering again about the need spread syntax over the attribute, which could be stripped out by babel for sure.

@@ -432,7 +435,11 @@ function DashboardList(props: DashboardListProps) {
className="action-button"
onClick={confirmDelete}
>
<ListViewCard.MenuIcon name="trash" /> Delete
<ListViewCard.MenuIcon
{...{ 'data-test': 'dashboard-card-view-trash-icon' }}
Copy link
Member

Choose a reason for hiding this comment

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

same spread question here :D

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

Ok, I went through and added lots of little questions/comments/concerns. I think this is quite close to mergeable, but would like to resolve those conversations in the thread first.

@codecov-io
Copy link

codecov-io commented Oct 13, 2020

Codecov Report

Merging #11134 into master will decrease coverage by 4.83%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11134      +/-   ##
==========================================
- Coverage   65.60%   60.77%   -4.84%     
==========================================
  Files         832      394     -438     
  Lines       39400    24716   -14684     
  Branches     3593        0    -3593     
==========================================
- Hits        25849    15021   -10828     
+ Misses      13442     9695    -3747     
+ Partials      109        0     -109     
Flag Coverage Δ
#cypress ?
#javascript ?
#python 60.77% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engine_specs/sqlite.py 65.62% <0.00%> (-9.38%) ⬇️
superset/utils/celery.py 82.14% <0.00%> (-3.58%) ⬇️
superset/result_set.py 96.69% <0.00%> (-1.66%) ⬇️
...rc/explore/components/controls/ViewportControl.jsx
.../src/dashboard/components/UndoRedoKeylisteners.jsx
superset-frontend/src/common/components/Tabs.tsx
superset-frontend/src/components/Label/index.tsx
superset-frontend/src/showSavedQuery/utils.js
...rc/dashboard/components/FilterIndicatorTooltip.jsx
...-frontend/src/dashboard/actions/dashboardLayout.js
... and 382 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88af85a...dae02cb. Read the comment docs.

@rusackas
Copy link
Member

@adam-stasiak should this PR be closed in favor of the newer ones?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants