Skip to content

Commit bf60a65

Browse files
2 parents d327526 + cad40e9 commit bf60a65

File tree

8 files changed

+367
-85
lines changed

8 files changed

+367
-85
lines changed

.github/workflows/CI-Suite.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
browser: electron
5757
command: | #EDITAR AQUÍ EL ARCHIVO SUITE A EJECUTAR:
58-
yarn file cypress/e2e/Tests/Interactions/GX3-132-Draggable.cy.js
58+
yarn file cypress/e2e/Tests/Widgets/GX3-440-SelecMenuTest.cy.js
5959
6060
- name: ✅Import Test Results to Xray
6161
if: always()
@@ -65,7 +65,7 @@ jobs:
6565
password: ${{secrets.XRAY_CLIENT_SECRET}}
6666
testFormat: 'junit' #OPCIONES PARA CAMBIAR: 'junit' (para xml) o 'cucumber' (para json)
6767
testPaths: 'reports/test-results.xml' #OPCIONES: '/test-results.xml' o 'cucumber-report.json'
68-
testExecKey: 'GX3-134' #EDITAR AQUÍ EL TEST EXECUTION A IMPORTAR LAS PRUEBAS.
68+
testExecKey: 'GX3-447' #EDITAR AQUÍ EL TEST EXECUTION A IMPORTAR LAS PRUEBAS.
6969
projectKey: 'GX3' #EDITAR EN CASO DE TRABAJAR CON OTRO PROYECTO.
7070

7171
- name: 🔔Slack Notification of Done
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import { removeLogs } from '@helper/RemoveLogs';
2-
import { broken } from '@pages/Elements/GX-19315-Broken.Page';
1+
// import { removeLogs } from '@helper/RemoveLogs';
2+
// import { broken } from '@pages/Elements/GX-19315-Broken.Page';
33

4-
describe('✅ToolsQA | Elements | Broken', () => {
5-
beforeEach('Be located in demoqa/broken', () => {
6-
cy.visit('/broken');
7-
cy.url().should('contain', 'broken');
8-
});
9-
it('19316 | TC1: Validate image "TOOLS QA" is displayed correctly', () => {
10-
broken.elements.validImageText().should('exist'); // verifica que el texto 'Valid image'exista
11-
broken.elements.validImage().should('be.visible');
12-
broken.elements.validImage().should('have.attr', 'src', '/images/Toolsqa.jpg'); // Verifica el atributo src de la imagen
13-
broken.elements.validImage().invoke('prop', 'naturalWidth').should('equal', 347); // Verifica el ancho de la imagen
14-
broken.elements.validImage().invoke('prop', 'naturalHeight').should('equal', 100); // Verifica el alto de la imagen
15-
});
4+
// describe('✅ToolsQA | Elements | Broken', () => {
5+
// beforeEach('Be located in demoqa/broken', () => {
6+
// cy.visit('/broken');
7+
// cy.url().should('contain', 'broken');
8+
// });
9+
// it('19316 | TC1: Validate image "TOOLS QA" is displayed correctly', () => {
10+
// broken.elements.validImageText().should('exist'); // verifica que el texto 'Valid image'exista
11+
// broken.elements.validImage().should('be.visible');
12+
// broken.elements.validImage().should('have.attr', 'src', '/images/Toolsqa.jpg'); // Verifica el atributo src de la imagen
13+
// broken.elements.validImage().invoke('prop', 'naturalWidth').should('equal', 347); // Verifica el ancho de la imagen
14+
// broken.elements.validImage().invoke('prop', 'naturalHeight').should('equal', 100); // Verifica el alto de la imagen
15+
// });
1616

17-
it('19316 | TC2: Validate image is broken and says "broken image"', () => {
18-
broken.elements.brokenImageText().should('exist');
19-
broken.elements.invalidImage().should('be.visible');
20-
broken.elements.invalidImage().should('have.attr', 'src', '/images/Toolsqa_1.jpg'); // Verifica el atributo src de la imagen
21-
broken.elements.invalidImage().invoke('prop', 'naturalWidth').should('equal', 0);
22-
broken.elements.invalidImage().invoke('prop', 'naturalHeight').should('equal', 0);
23-
});
17+
// it('19316 | TC2: Validate image is broken and says "broken image"', () => {
18+
// broken.elements.brokenImageText().should('exist');
19+
// broken.elements.invalidImage().should('be.visible');
20+
// broken.elements.invalidImage().should('have.attr', 'src', '/images/Toolsqa_1.jpg'); // Verifica el atributo src de la imagen
21+
// broken.elements.invalidImage().invoke('prop', 'naturalWidth').should('equal', 0);
22+
// broken.elements.invalidImage().invoke('prop', 'naturalHeight').should('equal', 0);
23+
// });
2424

25-
it('19316 | TC3: Validate do click on the link "Click Here for Valid Link" successfully redirects the page', () => {
26-
broken.clickValidLinkAndVerifyRedirection();
27-
cy.url().should('contain', 'demoqa.com');
28-
cy.title().should('not.be.empty');
29-
});
25+
// it('19316 | TC3: Validate do click on the link "Click Here for Valid Link" successfully redirects the page', () => {
26+
// broken.clickValidLinkAndVerifyRedirection();
27+
// cy.url().should('contain', 'demoqa.com');
28+
// cy.title().should('not.be.empty');
29+
// });
3030

31-
it('19316 | TC4: Validate do click on the link "Click Here for Broken Link" shows an error message', () => {
32-
broken.clickBrokenLinkAndVerifyErrorMessage();
33-
cy.should('contain', 'Click Here for Broken Link');
34-
broken.elements.errorMessage().should('exist');
35-
});
36-
});
31+
// it('19316 | TC4: Validate do click on the link "Click Here for Broken Link" shows an error message', () => {
32+
// broken.clickBrokenLinkAndVerifyErrorMessage();
33+
// cy.should('contain', 'Click Here for Broken Link');
34+
// broken.elements.errorMessage().should('exist');
35+
// });
36+
// });
3737

38-
removeLogs();
38+
// removeLogs();
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import { removeLogs } from '@helper/RemoveLogs';
2-
removeLogs();
1+
// import { removeLogs } from '@helper/RemoveLogs';
2+
// removeLogs();
33

4-
describe.skip('US GX-23133 | ToolsQA | Elements | Broken Links Images', () => {
5-
beforeEach('PRC: Usuario debe ubicarse en la Broken Links Page', () => {
6-
cy.visit('https://demoqa.com/broken');
7-
});
4+
// describe.skip('US GX-23133 | ToolsQA | Elements | Broken Links Images', () => {
5+
// beforeEach('PRC: Usuario debe ubicarse en la Broken Links Page', () => {
6+
// cy.visit('https://demoqa.com/broken');
7+
// });
88

9-
it('23134 | TC01: Validar visualizar correctamente imagen de ToolsQA al tomar la Valid Image', () => {
10-
cy.get('div>img[src="/images/Toolsqa.jpg"]').should('be.visible').and('have.prop', 'naturalWidth').and('be.greaterThan', 0);
11-
});
9+
// it('23134 | TC01: Validar visualizar correctamente imagen de ToolsQA al tomar la Valid Image', () => {
10+
// cy.get('div>img[src="/images/Toolsqa.jpg"]').should('be.visible').and('have.prop', 'naturalWidth').and('be.greaterThan', 0);
11+
// });
1212

13-
it('23134 | TC02: Validar visualizar ícono de imagen roto al tomar la Broken Image', () => {
14-
cy.get('div>img[src="/images/Toolsqa_1.jpg"]').should('be.visible').and('have.prop', 'naturalWidth').and('be.eq', 0);
15-
});
13+
// it('23134 | TC02: Validar visualizar ícono de imagen roto al tomar la Broken Image', () => {
14+
// cy.get('div>img[src="/images/Toolsqa_1.jpg"]').should('be.visible').and('have.prop', 'naturalWidth').and('be.eq', 0);
15+
// });
1616

17-
it('23134 | TC03: Validar poder redirigirse a la main page al ingresar el Valid Link', () => {
18-
cy.get('a[href="http://demoqa.com"]').click();
19-
cy.url().should('contain', 'demoqa');
20-
});
17+
// it('23134 | TC03: Validar poder redirigirse a la main page al ingresar el Valid Link', () => {
18+
// cy.get('a[href="http://demoqa.com"]').click();
19+
// cy.url().should('contain', 'demoqa');
20+
// });
2121

22-
it('23134 | TC04: Validar que el link devuelva un “500 status code” al ingresar al Broken Link', () => {
23-
cy.get('a[href="http://the-internet.herokuapp.com/status_codes/500"]').click();
24-
cy.get('#content p').should('contain', '500 status code');
25-
});
26-
});
22+
// it('23134 | TC04: Validar que el link devuelva un “500 status code” al ingresar al Broken Link', () => {
23+
// cy.get('a[href="http://the-internet.herokuapp.com/status_codes/500"]').click();
24+
// cy.get('#content p').should('contain', '500 status code');
25+
// });
26+
// });
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
import { removeLogs } from '@helper/RemoveLogs';
2-
import { brokenL } from '@pages/Elements/GX-23722-BrokenLinks';
3-
import data from '@data/GX-23722-BrokenLink.json';
1+
// import { removeLogs } from '@helper/RemoveLogs';
2+
// import { brokenL } from '@pages/Elements/GX-23722-BrokenLinks';
3+
// import data from '@data/GX-23722-BrokenLink.json';
44

5-
describe.skip('ToolsQA | Elements | Broken Links Images', () => {
6-
beforeEach('Usuario debe estar en la website', () => {
7-
cy.visit('/broken');
8-
});
5+
// describe.skip('ToolsQA | Elements | Broken Links Images', () => {
6+
// beforeEach('Usuario debe estar en la website', () => {
7+
// cy.visit('/broken');
8+
// });
99

10-
it('GX-23722 | TC1: Validar las propiedades de imagen valida', () => {
11-
brokenL.get.ValidImage().should('to.exist').and('have.prop', 'width', 347).and('have.prop', 'height', 100);
12-
});
10+
// it('GX-23722 | TC1: Validar las propiedades de imagen valida', () => {
11+
// brokenL.get.ValidImage().should('to.exist').and('have.prop', 'width', 347).and('have.prop', 'height', 100);
12+
// });
1313

14-
it('GX-23722 | TC2: Validar las propiedades de imagen rota', () => {
15-
brokenL.get.BrokedImage().then(image => {
16-
expect(image).to.be.exist;
17-
expect(image).to.have.prop('naturalWidth').to.be.equal(0);
18-
expect(image).to.have.prop('naturalHeight').to.be.equal(0);
19-
});
20-
});
14+
// it('GX-23722 | TC2: Validar las propiedades de imagen rota', () => {
15+
// brokenL.get.BrokedImage().then(image => {
16+
// expect(image).to.be.exist;
17+
// expect(image).to.have.prop('naturalWidth').to.be.equal(0);
18+
// expect(image).to.have.prop('naturalHeight').to.be.equal(0);
19+
// });
20+
// });
2121

22-
it('GX-23722 | TC3: Validar las propiedades de link valido', () => {
23-
cy.intercept('GET', data.ValidURL).as('Link1');
24-
brokenL.clickLink(1);
25-
cy.wait('@Link1').its('response.statusCode').should('eq', 200);
26-
});
22+
// it('GX-23722 | TC3: Validar las propiedades de link valido', () => {
23+
// cy.intercept('GET', data.ValidURL).as('Link1');
24+
// brokenL.clickLink(1);
25+
// cy.wait('@Link1').its('response.statusCode').should('eq', 200);
26+
// });
2727

28-
it('GX-23722 | TC4: Validar las propiedades de link roto', () => {
29-
cy.intercept('GET', data.BrokedURL).as('Link2');
30-
brokenL.clickLink(2);
31-
cy.wait('@Link2').its('response.statusCode').should('eq', 500);
32-
});
33-
});
28+
// it('GX-23722 | TC4: Validar las propiedades de link roto', () => {
29+
// cy.intercept('GET', data.BrokedURL).as('Link2');
30+
// brokenL.clickLink(2);
31+
// cy.wait('@Link2').its('response.statusCode').should('eq', 500);
32+
// });
33+
// });
3434

35-
removeLogs();
35+
// removeLogs();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import { SelectMenuPage } from '@pages/Widgets/GX3-440-SelecMenuPage';
2+
3+
describe('GX3-440 | ToolsQA | Widgets | SelectMenu - Select Menu', () => {
4+
beforeEach('Precondition: Visit website DemoQA', () => {
5+
cy.visit('https://demoqa.com/select-menu');
6+
});
7+
8+
it('440 | TC1: Validate dropdown "Select Value" by select each one.', () => {
9+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
10+
SelectMenuPage.clickSelectValue();
11+
SelectMenuPage.get.optionA().should('have.text', data.selectValue.group1.OptionA);
12+
SelectMenuPage.get.optionB().should('have.text', data.selectValue.group1.OptionB);
13+
SelectMenuPage.get.optionC().should('have.text', data.selectValue.group2.OptionC);
14+
SelectMenuPage.get.optionD().should('have.text', data.selectValue.group2.OptionD);
15+
SelectMenuPage.get.optionE().should('have.text', data.selectValue.outOfGroup.OptionE);
16+
SelectMenuPage.get.optionF().should('have.text', data.selectValue.outOfGroup.OptionF);
17+
});
18+
});
19+
20+
it('440 | TC2: Validate dropdown "Select Value" by selecting a random one.', () => {
21+
// Hacer clic en el menú desplegable "Select Value"
22+
SelectMenuPage.clickSelectValue();
23+
// Obtener todas las opciones del menú
24+
SelectMenuPage.get.allOptionsSelectValue().then(options => {
25+
// Obtener la longitud de las opciones
26+
const max = options.length - 1;
27+
// Seleccionar una opción aleatoria
28+
const randomIndex = Cypress._.random(0, max);
29+
options.eq(randomIndex);
30+
// Verificar que la opción seleccionada contenga el texto 'option'
31+
SelectMenuPage.get.allOptionsSelectValue().should('contain.text', 'option');
32+
});
33+
});
34+
35+
it('440 | TC3: Validate show message "No options" when the type text not match in SelectMenu "Select Value"', () => {
36+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
37+
// Iniciar la acción de escribir texto en el campo de selección
38+
SelectMenuPage.typeSelectValue('Hola');
39+
// Verificar que el mensaje mostrado sea el esperado desde el fixture
40+
SelectMenuPage.get.inputInvalidSelectValue().should('have.text', data.selectValue.messageSelectValue);
41+
});
42+
});
43+
44+
it('440 | TC4: Validate dropdown "Select One" by selecting a random one.', () => {
45+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
46+
// Hacer clic en el menú desplegable "Select Value"
47+
// Realiza la acción en el selectOne según el fixture
48+
SelectMenuPage.clickSelectOne();
49+
50+
// Obtén una opción aleatoria del fixture
51+
const randomOption = Cypress._.sample(data.selectOne.options);
52+
53+
// Ingresa el texto aleatorio en el input del selectOne
54+
SelectMenuPage.typeSelectOne(randomOption);
55+
56+
// Realiza assertions según sea necesario
57+
// En este ejemplo, verifica que el valor seleccionado sea el mismo que ingresaste
58+
SelectMenuPage.get.allOptionsSelectOne().should('not.have.text', 'option');
59+
});
60+
});
61+
62+
it('440 | TC5: Validate show massage "No options" when the type text not match in SelectMenu "Select One"', () => {
63+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
64+
// Iniciar la acción de escribir texto en el campo de selección
65+
SelectMenuPage.typeSelectOne('HolaQueTal');
66+
// Verificar que el mensaje mostrado sea el esperado desde el fixture
67+
SelectMenuPage.get.inputInvalidSelectOne().should('have.text', data.selectOne.messageSelectOne);
68+
});
69+
});
70+
71+
it('440 | TC6: Validate dropdown "Old Style Select Menu" by selecting a random one.', () => {
72+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
73+
SelectMenuPage.clickOldSelectMenu();
74+
const randomOption = Cypress._.sample(data.oldSelectMenu.options);
75+
SelectMenuPage.typeSelectMenu(randomOption);
76+
SelectMenuPage.get.containerOldSelectMenu().should('not.have.text', 'option');
77+
});
78+
});
79+
80+
it('440 | TC7: Validate dropdown "Multiselect drop down" by selecting a random one.', () => {
81+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
82+
SelectMenuPage.clickMultiselect();
83+
const randomOption = Cypress._.sample(data.multiselect.options);
84+
SelectMenuPage.typeMultiselect(randomOption);
85+
SelectMenuPage.get.containerMultiselect().should('not.have.text', 'option');
86+
});
87+
});
88+
89+
it('440 | TC8: Validate dropdown "Multiselect drop down" by selecting all four.', () => {
90+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
91+
SelectMenuPage.clickMultiselect();
92+
SelectMenuPage.clickAllOptionsMultiselect();
93+
const arrayToString = data.multiselect.options.toString();
94+
const replaceInString = arrayToString.replaceAll(/,/g, '');
95+
SelectMenuPage.get.selectedOptionMultiselect().should('contain.text', replaceInString);
96+
});
97+
});
98+
99+
it('440 | TC9: Validate show massage "No options" when the type text not match in SelectMenu "Multiselect drop down"', () => {
100+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
101+
// Iniciar la acción de escribir texto en el campo de selección
102+
SelectMenuPage.typeMultiselect('Morado');
103+
// Verificar que el mensaje mostrado sea el esperado desde el fixture
104+
SelectMenuPage.get.inputInvalidMultiselect().should('have.text', data.multiselect.messageMultiselect);
105+
});
106+
});
107+
108+
it('440 | TC10: Validate dropdown "Standard multi select" by selecting a random one.', () => {
109+
cy.fixture('/data/Widgets/GX3-440-SelecMenu.json').then(data => {
110+
SelectMenuPage.get.allOptionsStandardSelect().then(elm => {
111+
const max = elm.length - 1;
112+
const random = Cypress._.random(0, max);
113+
SelectMenuPage.get.allOptionsStandardSelect().eq(random).should('have.text', data.standardSelect.options[random]);
114+
});
115+
});
116+
});
117+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"selectValue": {
3+
"group1": {
4+
"OptionA": "Group 1, option 1",
5+
"OptionB": "Group 1, option 2"
6+
},
7+
"group2": {
8+
"OptionC": "Group 2, option 1",
9+
"OptionD": "Group 2, option 2"
10+
},
11+
"outOfGroup": {
12+
"OptionE": "A root option",
13+
"OptionF": "Another root option"
14+
},
15+
"messageSelectValue": "No options"
16+
},
17+
"selectOne": {
18+
"options": ["Dr.", "Mr.", "Mrs.", "M.", "Prof.", "Other"],
19+
"messageSelectOne": "No options"
20+
},
21+
"oldSelectMenu": {
22+
"options": ["Red", "Blue", "Green", "Yellow", "Purple", "Black", "White", "Voilet", "Indigo", "Magenta", "Aqua"],
23+
"default": "red"
24+
},
25+
"multiselect": {
26+
"options": ["Green", "Blue", "Black", "Red"],
27+
"messageMultiselect": "No options"
28+
},
29+
"standardSelect": {
30+
"options": ["Volvo", "Saab", "Opel", "Audi"]
31+
}
32+
}

0 commit comments

Comments
 (0)