-
Notifications
You must be signed in to change notification settings - Fork 3
Gx 23722 ✅ tools qa elements broken links images #386
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
The head ref may contain hidden characters: "GX-23722-\u2705-tools-qa-elements-broken-links-images"
Changes from 3 commits
78e8c21
70bf896
257277c
d688098
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { removeLogs } from '@helper/RemoveLogs'; | ||
import { brokenL } from '@pages/Elements/GX-23722-BrokenLinks'; | ||
import data from '@data/GX-23722-BrokenLink.json'; | ||
|
||
describe('ToolsQA | Elements | Broken Links Images', () => { | ||
beforeEach('Usuario debe estar en la website', () => { | ||
cy.visit('/broken'); | ||
}); | ||
|
||
it('GX-23722 | TC1: Validar las propiedades de imagen valida', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No olvides que los títulos solo tienen al comienzo el numero del summary ,es decir, sin el 'GX-' |
||
brokenL.get.ValidImage().should('to.exist').and('have.prop', 'width', 347).and('have.prop', 'height', 100); | ||
}); | ||
|
||
it('GX-23722 | TC2: Validar las propiedades de imagen rota', () => { | ||
brokenL.get.BrokedImage().then(image => { | ||
expect(image).to.be.exist; | ||
expect(image).to.have.prop('naturalWidth').to.be.equal(0); | ||
expect(image).to.have.prop('naturalHeight').to.be.equal(0); | ||
}); | ||
}); | ||
|
||
it('GX-23722 | TC3: Validar las propiedades de link valido', () => { | ||
cy.intercept('GET', data.ValidURL).as('Link1'); | ||
brokenL.clickLink(1); | ||
cy.wait('@Link1').its('response.statusCode').should('eq', 200); | ||
}); | ||
|
||
it('GX-23722 | TC4: Validar las propiedades de link roto', () => { | ||
cy.intercept('GET', data.BrokedURL).as('Link2'); | ||
brokenL.clickLink(2); | ||
cy.wait('@Link2').its('response.statusCode').should('eq', 500); | ||
}); | ||
}); | ||
|
||
removeLogs(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"ValidURL":"https://demoqa.com/", | ||
"BrokedURL":"http://the-internet.herokuapp.com/status_codes/500" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class BrokenLinks{ | ||
|
||
get={ | ||
ValidImage: ()=> cy.get('[class^="col-12"] [src$="/Toolsqa.jpg"]'), | ||
BrokedImage: ()=> cy.get('[src$="/Toolsqa_1.jpg"]'), | ||
AllLinks: numberLink => cy.get('[class^="col-12"] a').eq(`${numberLink}`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aquí con la data podrías aprovechar el Link, similar como lo implementaste pero obtenerlo directamente con la propiedad href ya que esta es la que contiene el link a la pagina |
||
|
||
} | ||
|
||
|
||
clickLink(numberLink){ | ||
this.get.AllLinks(numberLink-1).click(); | ||
} | ||
|
||
|
||
} | ||
|
||
export const brokenL = new BrokenLinks(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
QA should perform validation of the following functionality | ||
|
||
As a QA learner, | ||
|
||
I want to test: | ||
|
||
valid image. | ||
|
||
broken image. | ||
|
||
valid link | ||
|
||
invalid link. | ||
|
||
So that I can improve my testing skills for this scenario. | ||
|
||
✅ACCEPTANCE CRITERIA | ||
|
||
(This feature doesn’t need BDD AC - Please take a look into the BRS tab) | ||
|
||
|
||
🚩BUSINESS RULES SPEC | ||
|
||
For the first image on the page: | ||
|
||
THEN: the Tools QA logo must be displayed correctly. | ||
|
||
For the broken image: | ||
|
||
THEN: must appear a broken image icon. | ||
|
||
For the valid link: | ||
|
||
THEN: the link must be working correctly. | ||
|
||
Destination: https://demoqa.com/ | ||
|
||
For the invalid link: | ||
|
||
THEN: must go to a webpage showing a 500 status code. | ||
|
||
Destination: http://the-internet.herokuapp.com/status_codes/500 |
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.
Muy bien el uso de la ruta para data