Add label on button

This commit is contained in:
Paulo Gustavo Veiga 2022-10-31 17:49:16 -07:00
parent 9e43b9953e
commit e0ce593102
3 changed files with 23 additions and 23 deletions

View File

@ -2,15 +2,15 @@ context('Relationship Topics', () => {
beforeEach(() => {
cy.visit('/editor.html');
cy.reload();
cy.get('[test-id="30-11-relationship"]').click({ force: true });
cy.get('[test-id="30-11-relationship"]').first().click({ force: true });
});
it('Add Relationship', () => {
cy.contains('Features').click();
cy.get(`[aria-label="Add Relationship"]`).click();
cy.contains('Try it Now!').click();
cy.contains('Features').first().click();
cy.get(`[aria-label="Add Relationship"]`).first().click();
cy.contains('Try it Now!').first().click();
cy.get('[test-id="11-15-relationship"]').click({ force: true });
cy.get('[test-id="11-15-relationship"]').first().click({ force: true });
cy.matchImageSnapshot('addRelationship');
});

View File

@ -16,32 +16,32 @@ context('Edit Topic', () => {
it('Change Font Size', () => {
// Go to the minimal size.
cy.get(`[aria-label="Font Style"]`).trigger('mouseover');
cy.get(`[aria-label="Smaller"]`).click();
cy.get(`[aria-label="Smaller"]`).click();
cy.get(`[aria-label="Font Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Smaller"]`).first().click();
cy.get(`[aria-label="Smaller"]`).first().click();
// cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '8.1');
cy.matchImageSnapshot('changeFontSizeSmall');
cy.get(`[aria-label="Font Style"]`).trigger('mouseover');
cy.get(`[aria-label="Bigger"]`).click();
cy.get(`[aria-label="Font Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Bigger"]`).first().click();
// cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '10.8');
cy.matchImageSnapshot('changeFontSizeNormal');
cy.get(`[aria-label="Font Style"]`).trigger('mouseover');
cy.get(`[aria-label="Bigger"]`).click();
cy.get(`[aria-label="Font Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Bigger"]`).first().click();
// cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '13.4');
cy.matchImageSnapshot('changeFontSizeLarge');
cy.get(`[aria-label="Font Style"]`).trigger('mouseover');
cy.get(`[aria-label="Bigger"]`).click();
cy.get(`[aria-label="Font Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Bigger"]`).first().click();
// cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '20.2');
cy.matchImageSnapshot('changeFontSizeHuge');
// Can not scale it more.
cy.get(`[aria-label="Bigger"]`).click();
cy.get(`[aria-label="Bigger"]`).first().click();
// cy.get('[test-id=1] > text').invoke('attr', 'font-size').should('eq', '20.2');
cy.matchImageSnapshot('changeFontSizeHuge');

View File

@ -6,8 +6,8 @@ context('Change Topic shape', () => {
});
it('change to square shape', () => {
cy.get(`[aria-label="Topic Style"]`).trigger('mouseover');
cy.get(`[aria-label="Rectangle shape"]`).click();
cy.get(`[aria-label="Topic Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Rectangle shape"]`).first().click();
cy.get('[test-id=11] > rect').eq(1).invoke('attr', 'rx').then(parseInt).should('be.a', 'number').should('eq', 0);
@ -17,8 +17,8 @@ context('Change Topic shape', () => {
it('change to rounded rectangle', () => {
cy.contains('Mind Mapping').click();
cy.get(`[aria-label="Topic Style"]`).trigger('mouseover');
cy.get(`[aria-label="Rounded shape"]`).click();
cy.get(`[aria-label="Topic Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Rounded shape"]`).first().click();
// Todo: Check how to validate this. Difference when it run in docker vs test:integration
cy.get('[test-id=6] > rect').eq(1).invoke('attr', 'rx').then(parseInt).should('be.a', 'number').should('be.gte', 4);
@ -30,8 +30,8 @@ context('Change Topic shape', () => {
it('change to line', () => {
cy.contains('Try it Now!').click();
cy.get(`[aria-label="Topic Style"]`).trigger('mouseover');
cy.get(`[aria-label="Line shape"]`).click();
cy.get(`[aria-label="Topic Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Line shape"]`).first().click();
cy.matchImageSnapshot('changeToLine');
});
@ -39,8 +39,8 @@ context('Change Topic shape', () => {
it('change to ellipse shape', () => {
cy.contains('Productivity').click();
cy.get(`[aria-label="Topic Style"]`).trigger('mouseover');
cy.get(`[aria-label="Ellipse shape"]`).click();
cy.get(`[aria-label="Topic Style"]`).first().trigger('mouseover');
cy.get(`[aria-label="Ellipse shape"]`).first().click();
// Todo: Check how to validate this. Difference when it run in docker vs test:integration
cy.get('[test-id=2] > rect').eq(1).invoke('attr', 'rx').then(parseInt).should('be.a', 'number').should('be.gte', 12);