Skip to content

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

Merged
merged 4 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/CI-Suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ jobs:
with:
browser: chrome
command: | #EDITAR AQUÍ EL ARCHIVO SUITE A EJECUTAR:
yarn file cypress/e2e/Tests/Interactions/GX2-4365-Droppable.cy.js
yarn file cypress/e2e/Tests/Elements/GX-23722-Broken-link-image.cy.js

- name: ✅Import Test Results to Xray
if: always()
uses: mikepenz/xray-action@v2
with: #OPCIONES PARA IMPORTAR LOS RESULTADOS DE PRUEBA A JIRA XRAY:
username: ${{secrets.XRAY_CLIENT_ID}}
password: ${{secrets.XRAY_CLIENT_SECRET}}
testFormat: 'junit' #OPCIONES PARA CAMBIAR: 'junit' (para xml) o 'cucumber' (para json)
testPaths: 'reports/test-results.xml' #OPCIONES: '/test-results.xml' o 'cucumber-report.json'
testExecKey: 'GX2-4367' #EDITAR AQUÍ EL TEST EXECUTION A IMPORTAR LAS PRUEBAS.
projectKey: 'GX2' #EDITAR EN CASO DE TRABAJAR CON OTRO PROYECTO.
# - name: ✅Import Test Results to Xray
# if: always()
# uses: mikepenz/xray-action@v2
# with: #OPCIONES PARA IMPORTAR LOS RESULTADOS DE PRUEBA A JIRA XRAY:
# username: ${{secrets.XRAY_CLIENT_ID}}
# password: ${{secrets.XRAY_CLIENT_SECRET}}
# testFormat: 'junit' #OPCIONES PARA CAMBIAR: 'junit' (para xml) o 'cucumber' (para json)
# testPaths: 'reports/test-results.xml' #OPCIONES: '/test-results.xml' o 'cucumber-report.json'
# testExecKey: 'GX-23724' #EDITAR AQUÍ EL TEST EXECUTION A IMPORTAR LAS PRUEBAS.
# projectKey: 'GX' #EDITAR EN CASO DE TRABAJAR CON OTRO PROYECTO.

- name: 🔔Slack Notification of Done
if: always()
Expand Down
35 changes: 35 additions & 0 deletions cypress/e2e/Tests/Elements/GX-23722-Broken-link-image.cy.js
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';
Copy link
Contributor

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


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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The 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();
4 changes: 4 additions & 0 deletions cypress/fixtures/data/GX-23722-BrokenLink.json
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"
}
18 changes: 18 additions & 0 deletions cypress/support/pages/Elements/GX-23722-BrokenLinks.js
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}`)
Copy link
Contributor

Choose a reason for hiding this comment

The 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();
42 changes: 42 additions & 0 deletions cypress/test-plan/in-sprint/sprint-21/GX-23722.md
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