-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import ButtonsPage from '../../pageObjects/buttons/ButtonsPage'; | ||
import ElementsLink from '../../support/Enum/links/Elements'; | ||
|
||
const Buttons = new ButtonsPage(); | ||
|
||
beforeEach(() => { | ||
cy.visitarToolsQA(ElementsLink.Buttons); | ||
}); | ||
|
||
describe('Botão Double Click', () => { | ||
it('Verificar se o botão Double Click funciona e apresenta mensagem', () => { | ||
Buttons.dbClickButton(true); | ||
Buttons.dbClickMsg(true); | ||
}); | ||
|
||
it('Verificar se DB click não funciona apenas com 1 click e não apresenta mensagem', () => { | ||
Buttons.dbClickButton(false); | ||
Buttons.dbClickMsg(false); | ||
}); | ||
}); | ||
|
||
describe('Botão Right Click', () => { | ||
it('Verificar se Right click fubciona e apresenta mensagem', () => { | ||
Buttons.rightClick(true); | ||
Buttons.rightClickMsg(true); | ||
}); | ||
|
||
it('Verificar se Right Click não funciona com Left Click e não apresenta mensagem', () => { | ||
Buttons.rightClick(false); | ||
Buttons.rightClickMsg(false); | ||
}); | ||
}); | ||
|
||
describe('Dynamic Click', () => { | ||
it('Verificar se o clique dinâmico funciona e apresenta mensagem', () => { | ||
Buttons.dynamicClick(); | ||
Buttons.dynamicClickMsg(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const ButtonsLocators = { | ||
dbClickBtn: 'button#doubleClickBtn', | ||
rightClickBtn: 'button#rightClickBtn', | ||
dynamicBtnByXpath: '//button[text() = "Click Me"]', | ||
dbClickMsg: 'p#doubleClickMessage', | ||
rightClickMsg: 'p#rightClickMessage', | ||
dynamicClickMsg: 'p#dynamicClickMessage', | ||
}; | ||
|
||
export default ButtonsLocators; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import locator from './ButtonsLocatos'; | ||
import mensagens from '../../support/Enum/ButtonsMsg'; | ||
|
||
class ButtonsPage { | ||
dbClickButton(dbClick: boolean) { | ||
dbClick === true | ||
? cy.get(locator.dbClickBtn).dblclick() | ||
: cy.get(locator.dbClickBtn).click(); | ||
} | ||
|
||
dbClickMsg(exist: boolean) { | ||
exist === true | ||
? cy | ||
.get(locator.dbClickMsg) | ||
.should('exist') | ||
.and('contain.text', mensagens.DbClickMsg) | ||
.and('be.visible') | ||
: cy.get(locator.dbClickMsg).should('not.exist'); | ||
} | ||
|
||
rightClick(rightClick: boolean) { | ||
rightClick === true | ||
? cy.get(locator.rightClickBtn).rightclick() | ||
: cy.get(locator.rightClickBtn).click(); | ||
} | ||
|
||
rightClickMsg(exist: boolean) { | ||
exist === true | ||
? cy | ||
.get(locator.rightClickMsg) | ||
.should('exist') | ||
.and('contain.text', mensagens.RightClickMsg) | ||
.and('be.visible') | ||
: cy.get(locator.rightClickMsg).should('not.exist'); | ||
} | ||
|
||
dynamicClick() { | ||
cy.xpath(locator.dynamicBtnByXpath).click(); | ||
} | ||
|
||
dynamicClickMsg() { | ||
cy | ||
.get(locator.dynamicClickMsg) | ||
.should('exist') | ||
.and('contain.text', mensagens.DynamiClickMsg) | ||
.and('be.visible'); | ||
} | ||
} | ||
|
||
export default ButtonsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
enum ButtonsMsg { | ||
DbClickMsg = 'You have done a double click', | ||
RightClickMsg = 'You have done a right click', | ||
DynamiClickMsg = 'You have done a dynamic click', | ||
} | ||
|
||
export default ButtonsMsg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters