-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): test before sonarqube analysis
- make sure test results are available for coverage measurement
- Loading branch information
Showing
9 changed files
with
139 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,9 @@ jobs: | |
with: | ||
files: | | ||
**/TEST-*.xml | ||
- name: Analyze with SonarQube | ||
if: always() | ||
# You can pin the exact commit or the version. | ||
# uses: SonarSource/[email protected] | ||
uses: sonarsource/sonarqube-scan-action@master | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
const PORT = process.env.PORT || 3000; | ||
const PORT = process.env.PORT || 5173; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: `http://localhost:${PORT}/meeting`, | ||
video: true, | ||
projectId: "pjkkoc" | ||
}, | ||
}) | ||
e2e: { | ||
baseUrl: `http://localhost:${PORT}/meeting`, | ||
video: true, | ||
projectId: "pjkkoc" | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
/// <reference types="cypress" /> | ||
|
||
context('Error handling', () => { | ||
describe('Error getting user', () => { | ||
before(() => { | ||
cy.intercept('/meeting/api/v1/users/findUserByUrl?url=christian-gawron', { statusCode: 500, body: { error: "no data" } }).as('getUser') | ||
cy.visit('/schedule/christian-gawron/sprechstunde') | ||
}) | ||
describe('Error getting user', () => { | ||
before(() => { | ||
cy.intercept('/api/v1/users/findUserByUrl?url=christian-gawron', { statusCode: 500, body: { error: "no data" } }).as('getUser') | ||
cy.visit('/schedule/christian-gawron/sprechstunde') | ||
}) | ||
|
||
it('Should show error message', () => { | ||
cy.wait(['@getUser'], { timeout: 10000 }) | ||
cy.get('.error') | ||
}) | ||
it('Should show error message', () => { | ||
cy.wait(['@getUser'], { timeout: 10000 }) | ||
cy.get('.error') | ||
}) | ||
}) | ||
}) | ||
|
||
context('Scheduling page', () => { | ||
beforeEach(() => { | ||
//const now = new Date(2021, 4, 25).getTime() | ||
cy.clock(Date.UTC(2021, 4, 25), ['Date']) | ||
cy.intercept('/meeting/api/v1/users/findUserByUrl?url=christian-gawron', { fixture: 'userByURL' }).as('getUser') | ||
cy.intercept('/meeting/api/v1/events/getEventBy?user=109150731150582581691&url=sprechstunde', { fixture: 'event' }).as('getEvent') | ||
cy.intercept('/meeting/api/v1/events/getAvailable?*', { fixture: 'available' }).as('getAvailable') | ||
}) | ||
beforeEach(() => { | ||
//const now = new Date(2021, 4, 25).getTime() | ||
cy.clock(Date.UTC(2021, 4, 25), ['Date']) | ||
cy.intercept('/api/v1/users/findUserByUrl?url=christian-gawron', { fixture: 'userByURL' }).as('getUser') | ||
cy.intercept('/api/v1/events/getEventBy?user=109150731150582581691&url=sprechstunde', { fixture: 'event' }).as('getEvent') | ||
cy.intercept('/api/v1/events/getAvailable?*', { fixture: 'available' }).as('getAvailable') | ||
}) | ||
|
||
describe('Visit scheduling page and schedule appointment', () => { | ||
before(() => { | ||
cy.intercept('POST', '/meeting/api/v1/**', { body: { error: 'not possible' } }).as('apiCheck') | ||
cy.visit('/schedule/christian-gawron/sprechstunde') | ||
}) | ||
describe('Visit scheduling page and schedule appointment', () => { | ||
before(() => { | ||
cy.intercept('POST', '/api/v1/**', { body: { error: 'not possible' } }).as('apiCheck') | ||
cy.visit('/schedule/christian-gawron/sprechstunde') | ||
}) | ||
|
||
it('Check simple schedule flow', () => { | ||
cy.wait(['@getUser', '@getEvent', '@getAvailable'], { timeout: 10000 }) | ||
cy.get('h6').should('contain', 'Christian Gawron') | ||
cy.get('.MuiPickersDay-today').should('contain', '25') | ||
cy.contains('07:00').click() | ||
cy.get('[name=name]').type('Max Mustermann') | ||
cy.get('[name=email]').type('[email protected]') | ||
cy.get('form').submit() | ||
cy.wait('@apiCheck', { timeout: 10000 }).then((interception) => { | ||
cy.log(interception.request.body) | ||
assert.equal(interception.request.body.name, 'Max Mustermann') | ||
}) | ||
}) | ||
it('Check simple schedule flow', () => { | ||
cy.wait(['@getUser', '@getEvent', '@getAvailable'], { timeout: 10000 }) | ||
cy.get('h6').should('contain', 'Christian Gawron') | ||
cy.get('.MuiPickersDay-today').should('contain', '25') | ||
cy.contains('07:00').click() | ||
cy.get('[name=name]').type('Max Mustermann') | ||
cy.get('[name=email]').type('[email protected]') | ||
cy.get('form').submit() | ||
cy.wait('@apiCheck', { timeout: 10000 }).then((interception) => { | ||
cy.log(interception.request.body) | ||
assert.equal(interception.request.body.name, 'Max Mustermann') | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Error creating appointment', () => { | ||
before(() => { | ||
cy.intercept('POST', '/meeting/api/v1/**', { statusCode: 400, body: { error: 'not possible' } }).as('apiCheck') | ||
cy.visit('/schedule/christian-gawron/sprechstunde') | ||
}) | ||
describe('Error creating appointment', () => { | ||
before(() => { | ||
cy.intercept('POST', '/api/v1/**', { statusCode: 400, body: { error: 'not possible' } }).as('apiCheck') | ||
cy.visit('/schedule/christian-gawron/sprechstunde') | ||
}) | ||
|
||
it('should show an error message', () => { | ||
cy.wait(['@getUser', '@getEvent', '@getAvailable'], { timeout: 10000 }) | ||
cy.get('h6').should('contain', 'Christian Gawron') | ||
cy.get('.MuiPickersDay-today').should('contain', '25') | ||
cy.contains('07:00').click() | ||
cy.get('[name=name]').type('Max Mustermann') | ||
cy.get('[name=email]').type('[email protected]') | ||
cy.get('form').submit() | ||
cy.wait('@apiCheck', { timeout: 10000 }) | ||
cy.get('.error') | ||
}) | ||
it('should show an error message', () => { | ||
cy.wait(['@getUser', '@getEvent', '@getAvailable'], { timeout: 10000 }) | ||
cy.get('h6').should('contain', 'Christian Gawron') | ||
cy.get('.MuiPickersDay-today').should('contain', '25') | ||
cy.contains('07:00').click() | ||
cy.get('[name=name]').type('Max Mustermann') | ||
cy.get('[name=email]').type('[email protected]') | ||
cy.get('form').submit() | ||
cy.wait('@apiCheck', { timeout: 10000 }) | ||
cy.get('.error') | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000/meeting", | ||
"projectId": "pjkkoc", | ||
"defaultCommandTimeout": 10000 | ||
} | ||
"baseUrl": "http://localhost:5173/meeting", | ||
"projectId": "pjkkoc", | ||
"defaultCommandTimeout": 10000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.