From bd60088dc894646c7cc86bdc42ea4624aa646751 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Fri, 27 Dec 2024 20:46:00 +0000 Subject: [PATCH] chore(tests): finish layout for welcome, add a few more tests and add placeholders for other features --- cypress/e2e/appearance.cy.js | 5 ++ cypress/e2e/date.cy.js | 5 ++ cypress/e2e/greeting.cy.js | 5 ++ cypress/e2e/marketplace.cy.js | 5 ++ cypress/e2e/message.cy.js | 5 ++ cypress/e2e/navbar.cy.js | 5 ++ cypress/e2e/quicklinks.cy.js | 5 ++ cypress/e2e/quote.cy.js | 5 ++ cypress/e2e/search.cy.js | 5 ++ cypress/e2e/stats.cy.js | 5 ++ cypress/e2e/time.cy.js | 5 ++ cypress/e2e/weather.cy.js | 5 ++ cypress/e2e/welcome.cy.js | 164 +++++++++++++++++++++++++++++++++- 13 files changed, 220 insertions(+), 4 deletions(-) create mode 100644 cypress/e2e/appearance.cy.js create mode 100644 cypress/e2e/date.cy.js create mode 100644 cypress/e2e/greeting.cy.js create mode 100644 cypress/e2e/marketplace.cy.js create mode 100644 cypress/e2e/message.cy.js create mode 100644 cypress/e2e/navbar.cy.js create mode 100644 cypress/e2e/quicklinks.cy.js create mode 100644 cypress/e2e/quote.cy.js create mode 100644 cypress/e2e/search.cy.js create mode 100644 cypress/e2e/stats.cy.js create mode 100644 cypress/e2e/time.cy.js create mode 100644 cypress/e2e/weather.cy.js diff --git a/cypress/e2e/appearance.cy.js b/cypress/e2e/appearance.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/appearance.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/date.cy.js b/cypress/e2e/date.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/date.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/greeting.cy.js b/cypress/e2e/greeting.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/greeting.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/marketplace.cy.js b/cypress/e2e/marketplace.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/marketplace.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/message.cy.js b/cypress/e2e/message.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/message.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/navbar.cy.js b/cypress/e2e/navbar.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/navbar.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/quicklinks.cy.js b/cypress/e2e/quicklinks.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/quicklinks.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/quote.cy.js b/cypress/e2e/quote.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/quote.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/search.cy.js b/cypress/e2e/search.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/search.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/stats.cy.js b/cypress/e2e/stats.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/stats.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/time.cy.js b/cypress/e2e/time.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/time.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/weather.cy.js b/cypress/e2e/weather.cy.js new file mode 100644 index 00000000..322992ce --- /dev/null +++ b/cypress/e2e/weather.cy.js @@ -0,0 +1,5 @@ +describe('template spec', () => { + it('passes', () => { + cy.visit('https://example.cypress.io') + }) +}) \ No newline at end of file diff --git a/cypress/e2e/welcome.cy.js b/cypress/e2e/welcome.cy.js index b661c0d2..3a020ed8 100644 --- a/cypress/e2e/welcome.cy.js +++ b/cypress/e2e/welcome.cy.js @@ -1,12 +1,12 @@ /* eslint-disable no-undef */ -describe('modal loads', () => { +describe('initial modal open', () => { it('passes', () => { cy.visit('http://localhost:5173') cy.get('.welcomeContent').should('be.visible') }) }) -describe('discord link works', () => { +describe('discord link', () => { it('passes', () => { cy.visit('http://localhost:5173') cy.get('.welcomeNotice a').eq(0).invoke('removeAttr', 'target').click() @@ -16,7 +16,7 @@ describe('discord link works', () => { }) }) -describe('contribute link works', () => { +describe('contribute link', () => { it('passes', () => { cy.visit('http://localhost:5173') cy.get('.welcomeNotice a').eq(1).invoke('removeAttr', 'target').click() @@ -26,7 +26,7 @@ describe('contribute link works', () => { }) }) -describe('preview function works', () => { +describe('preview function enable/disable', () => { it('passes', () => { cy.visit('http://localhost:5173') // does the preview button exist? @@ -41,4 +41,160 @@ describe('preview function works', () => { // are we back? cy.get('.welcomeContent').should('be.visible') }) +}) + +describe('second tab navigation', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + + // are we on the second tab? + cy.get('.languageSettings').should('be.visible') + }) +}) + +describe('change to each language setting and back', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + + // change to each language setting + cy.get('.languageSettings span').each(($el, index, $list) => { + // press the next one + cy.get('.languageSettings span').eq(index).click() + // is it checked? state=checked + cy.get('.languageSettings span').eq(index).should('have.attr', 'state', 'checked') + }) + }) +}) + +describe('third tab navigation', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + // go to second + cy.get('.welcomeButtons button').eq(1).click() + + // go to third + cy.get('.welcomeButtons button').eq(1).click() + }) +}) + +describe('import settings', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + }) +}) + +describe('fourth tab navigation', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + }) +}) + +describe('theme change', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + + }) +}) + +describe('fifth tab navigation', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + }) +}) + +describe('style choice', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + + }) +}) + +describe('sixth tab navigation', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + }) +}) + +describe('offline mode check', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + + }) +}) + +describe('privacy policy link', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeNotice a').eq(2).invoke('removeAttr', 'target').click() + cy.url().then(url => { + expect(url).to.include('github.com') + }) + }) +}) + +describe('source code link', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeNotice a').eq(2).invoke('removeAttr', 'target').click() + cy.url().then(url => { + expect(url).to.include('github.com') + }) + }) +}) + +describe('final tab navigation', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + }) +}) + +// describe the changes list + +describe('finish button', () => { + it('passes', () => { + cy.visit('http://localhost:5173') + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(1).click() + cy.get('.welcomeButtons button').eq(2).click() + }) }) \ No newline at end of file