-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(tests): add full e2e coverage for Tooltip component #4871
feat(tests): add full e2e coverage for Tooltip component #4871
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Need to move basic testing scope to integration/tooltip_page_spec.ts and full scope of tests to full/tooltip_page_spec.ts
- Need to move all logic to PO methods and reuse it in tests
- Need to cover each DEMO, according to rule: 1 use-case = 1 describe, 1 step = 1 it
- Need to make full coverage for all demos inside component
Codecov Report
@@ Coverage Diff @@
## development #4871 +/- ##
===============================================
- Coverage 75.85% 75.65% -0.21%
===============================================
Files 237 237
Lines 7336 7336
Branches 1464 1464
===============================================
- Hits 5565 5550 -15
- Misses 1369 1376 +7
- Partials 402 410 +8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## development #4871 +/- ##
============================================
Coverage 74.78% 74.78%
============================================
Files 281 281
Lines 8547 8547
Branches 1631 1631
============================================
Hits 6392 6392
Misses 1705 1705
Partials 450 450 Continue to review full report at Codecov.
|
7c5e5d2
to
b761c36
Compare
3f35e15
to
3fe3dc9
Compare
cypress/support/tooltip.po.ts
Outdated
|
||
isTooltipAppearOnFocus(baseSelector: string) { | ||
cy.get(`${baseSelector} ${this.togglerTooltip}`).focus(); | ||
this.isTooltipAppearsAndVisible(baseSelector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isTooltipAppearOnFocus => make just method focusOnTooltip(baseSelector, additionalSelector?:string)
cypress/support/tooltip.po.ts
Outdated
|
||
}; | ||
|
||
placementsOfTheTooltipContainer = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tooltipPlacements
cypress/support/tooltip.po.ts
Outdated
}; | ||
|
||
placementsOfTheTooltipContainer = { | ||
placementTop: { tooltipContainerClass: 'tooltip in tooltip-top bs-tooltip-top top show', name: 'Tooltip on top' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top:
right:
auto:
left:
bottom:
cypress/support/tooltip.po.ts
Outdated
cy.get(`${baseSelector} ${this.togglerTooltip}`).focus(); | ||
this.isTooltipAppearsAndVisible(this.body); | ||
} | ||
isCustomTriggersClickAppearsAndVisible(baseSelector: string, buttonName: string, tiggerEvent: string, tooltipText: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not descriptive name
cypress/support/tooltip.po.ts
Outdated
cy.get(`${baseSelector}`).should('to.have.descendants', this.containerTooltip); | ||
cy.get(`${this.containerTooltip}`).should('be.visible').contains(tooltipText); | ||
cy.get(`${baseSelector}`).contains('Toggle').click(); | ||
cy.get(`${baseSelector}`).should('not.to.have.descendants', this.containerTooltip); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need rework according to the previous comment
cypress/support/tooltip.po.ts
Outdated
} | ||
clickOnDemoMenu(subMenu: string) { | ||
cy.get('add-nav').contains('a', subMenu).click(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove it and reuse method from base component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove it and reuse method from base component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove it and reuse method from base component
3fe3dc9
to
7197cec
Compare
167cee9
to
8a118f9
Compare
cypress/full/tooltip_page_spec.ts
Outdated
|
||
describe('Placement tooltip', () => { | ||
|
||
const basic = tooltip.exampleDemosArr.placement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const basic => const placementDemo
cypress/full/tooltip_page_spec.ts
Outdated
|
||
describe('Dismiss tooltip', () => { | ||
|
||
const dismissPlacement = tooltip.exampleDemosArr.dismiss; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const dismissPlacement => const dismiss or const dismissDemo
cypress/full/tooltip_page_spec.ts
Outdated
|
||
describe('Dynamic Content', () => { | ||
|
||
const dynamicContentPlacement = tooltip.exampleDemosArr.dynamicTooltip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynamicContent
cypress/full/tooltip_page_spec.ts
Outdated
const basic = tooltip.exampleDemosArr.placement; | ||
const placement = tooltip.tooltipPlacements; | ||
|
||
it('when user on hovering on trigger btn in the Placement exmpl - tooltip appears on the setted placement', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when user hover on Trigger btn
cypress/full/tooltip_page_spec.ts
Outdated
const dynamicContentPlacement = tooltip.exampleDemosArr.dynamicTooltip; | ||
|
||
it('when user clicks on the Dynamic Content tooltip btn, Tooltip appears', () => { | ||
tooltip.focusOnTooltip(dynamicContentPlacement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clickOnTooltip
cypress/support/tooltip.po.ts
Outdated
dismiss: 'demo-tooltip-dismiss', | ||
dynamicTooltip: 'demo-tooltip-dynamic', | ||
customContentTemplate: 'demo-tooltip-custom-content', | ||
dynamicHtmlButton: 'demo-tooltip-dynamic-html', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynamicHtml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just dynamicHtml
cypress/support/tooltip.po.ts
Outdated
dynamicTooltip: 'demo-tooltip-dynamic', | ||
customContentTemplate: 'demo-tooltip-custom-content', | ||
dynamicHtmlButton: 'demo-tooltip-dynamic-html', | ||
defaultTooltip: 'demo-tooltip-container', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appendToBody
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appendToBody
cypress/full/tooltip_page_spec.ts
Outdated
const configuringDefaultsTooltip = tooltip.exampleDemosArr.configuringDefaults; | ||
|
||
it('when user clicks on the Configuring tooltip btn, Tooltip appears & dismiss after mouse leave', () => { | ||
tooltip.focusOnTooltip(configuringDefaultsTooltip); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
click
cy.get(basic).as('basicDemo').find(tooltip.togglerTooltip).focus(); | ||
cy.get('@basicDemo') | ||
.should('to.have.descendants', tooltip.containerTooltip); | ||
it('when the user on hovering on the trigger btn, tooltip appears and dismiss after mouse leave', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...user hover on the trigger btn...
cypress/support/tooltip.po.ts
Outdated
} | ||
clickOnDemoMenu(subMenu: string) { | ||
cy.get('add-nav').contains('a', subMenu).click(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove it and reuse method from base component
8a118f9
to
4317cad
Compare
51338c5
to
5f3a11b
Compare
cypress/full/tooltip_page_spec.ts
Outdated
describe('Configuring defaults', () => { | ||
const configuringDefaults = tooltip.exampleDemosArr.configuringDefaults; | ||
|
||
it('when user clicks on the Configuring tooltip btn, Tooltip appears & dismiss after mouse leave', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
& dismiss after mouse leave - looks like need to remove it
cypress/support/tooltip.po.ts
Outdated
dismiss: 'demo-tooltip-dismiss', | ||
dynamicTooltip: 'demo-tooltip-dynamic', | ||
customContentTemplate: 'demo-tooltip-custom-content', | ||
dynamicHtmlButton: 'demo-tooltip-dynamic-html', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just dynamicHtml
cypress/support/tooltip.po.ts
Outdated
dynamicTooltip: 'demo-tooltip-dynamic', | ||
customContentTemplate: 'demo-tooltip-custom-content', | ||
dynamicHtmlButton: 'demo-tooltip-dynamic-html', | ||
defaultTooltip: 'demo-tooltip-container', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appendToBody
cypress/support/tooltip.po.ts
Outdated
} | ||
clickOnDemoMenu(subMenu: string) { | ||
cy.get('add-nav').contains('a', subMenu).click(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove it and reuse method from base component
5f3a11b
to
0b11ed2
Compare
@dmitry-zhemchugov use commit convention properly |
via Hubstaff Project: int_ngx-bootstrap (OSS) - https://app.hubstaff.com/projects/304822 Grand total: 0:00:10 |
PR Checklist
Before creating new PR, please take a look at checklist below to make sure that you've done everything that needs to be done before we can merge it.