diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 67e21d844..21f65c109 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -13,7 +13,7 @@ const Home: NextPage = () => { return ( <> - Developers portal | Home + VTEX Developers diff --git a/src/tests/cypress/integration/catalog-API-page.spec.js b/src/tests/cypress/integration/catalog-API-page.spec.js new file mode 100644 index 000000000..155fe40e2 --- /dev/null +++ b/src/tests/cypress/integration/catalog-API-page.spec.js @@ -0,0 +1,34 @@ +/// + +describe('Catalog API', () => { + beforeEach(() => { + cy.visit('/docs/api-reference/catalog#overview') + }) + + it('API search', () => { + const typedText = 'Create SKU Service Value' + + cy.getRapidocElement('#nav-bar-search').type(`${typedText}{enter}`) + + cy.getRapidocElement('.nav-scroll').children('div').should('have.length', 5) + + cy.getRapidocElement('.nav-scroll') + .children('.nav-bar-tag-and-paths') + .should('have.length', 1) + .children('div') + .should('have.length', 2) + + cy.getRapidocElement('.nav-scroll') + .find('.nav-bar-tag-and-paths > div') + .eq(0) + .should('contain', 'SKU Service Value') + + cy.getRapidocElement('.nav-scroll') + .find('.nav-bar-tag-and-paths > div') + .eq(1) + .contains(typedText) + .click() + + cy.getRapidocElement('h2').should('contain', `${typedText}`) + }) +}) diff --git a/src/tests/cypress/support/commands.js b/src/tests/cypress/support/commands.js index 119ab03f7..e3152771a 100644 --- a/src/tests/cypress/support/commands.js +++ b/src/tests/cypress/support/commands.js @@ -23,3 +23,7 @@ // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) + +Cypress.Commands.add('getRapidocElement', (selector) => { + cy.get('rapi-doc').shadow().find(selector) +})