Skip to content

Commit 4e1e2af

Browse files
committed
smoketests
smoketests on push cypress commands.js cypress videos and screenshots cypress videos and screenshots wait smoketest
1 parent 3ffa6da commit 4e1e2af

4 files changed

Lines changed: 45 additions & 7 deletions

File tree

.github/workflows/smoketest.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
on:
22
schedule:
33
- cron: '*/5 * * * *'
4-
4+
push:
5+
name: Smoketest
56
jobs:
67
smoketest:
78
runs-on: ubuntu-latest
@@ -13,4 +14,16 @@ jobs:
1314
- name: Cypress run
1415
uses: cypress-io/github-action@v4
1516
with:
16-
spec: cypress/cypress/e2e/smoketest.cy.js
17+
working-directory: cypress
18+
#spec: cypress/cypress/e2e/smoketest.cy.js
19+
- uses: actions/upload-artifact@v2
20+
if: failure()
21+
with:
22+
name: cypress-screenshots
23+
path: cypress/cypress/screenshots
24+
# Test run video was always captured, so this action uses "always()" condition
25+
- uses: actions/upload-artifact@v2
26+
if: failure()
27+
with:
28+
name: cypress-videos
29+
path: cypress/cypress/videos

cypress/cypress/e2e/smoketest.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('Mob.sh Timer', () => {
5050
cy.wait(100)
5151
cy.get('.btn-close').click()
5252
let initialHistoryCountChainer = cy.get('#history-container').find('li').its('length')
53-
cy.get('#timer-button').contains(1).click().wait(100)
53+
cy.get('#timer-button').contains(1).click().wait(200)
5454
cy.get('#history-container').find('li').its('length').then(currentCount => {
5555
initialHistoryCountChainer.should('eq', currentCount - 1)
5656
})
@@ -63,7 +63,7 @@ describe('Mob.sh Timer', () => {
6363
cy.wait(100)
6464
cy.get('.btn-close').click()
6565
let initialHistoryCountChainer = cy.get('#history-container').find('li').its('length')
66-
cy.get('#breaktimer-button').contains(1).click().wait(100)
66+
cy.get('#breaktimer-button').contains(1).click().wait(200)
6767
cy.get('#history-container').find('li').its('length').then(currentCount => {
6868
initialHistoryCountChainer.should('eq', currentCount - 1)
6969
})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add('login', (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

src/main/java/sh/mob/timer/web/RoomApiController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@RequestMapping()
2525
public class RoomApiController {
2626

27-
private static final String SMOKETEST_ROOM_NAME = "testroom-310a9c47-515c-4ad7-a229-ae8efbab7387";
27+
private static final String SMOKETEST_ROOM_NAME_PREFIX = "testroom-";
2828
private static final Logger log = LoggerFactory.getLogger(RoomApiController.class);
2929
private final RoomRepository roomRepository;
3030
private final Clock clock;
@@ -83,7 +83,7 @@ public void publishEvent(@PathVariable String roomId, @RequestBody PutTimerReque
8383
timerRequest.timer,
8484
timerRequest.user,
8585
room.name());
86-
if (!Objects.equals(room.name(), SMOKETEST_ROOM_NAME)) {
86+
if (!room.name().startsWith(SMOKETEST_ROOM_NAME_PREFIX)) {
8787
stats.incrementTimer(timer);
8888
}
8989
} else if (timerRequest.breaktimer() != null) {
@@ -94,7 +94,7 @@ public void publishEvent(@PathVariable String roomId, @RequestBody PutTimerReque
9494
timerRequest.breaktimer(),
9595
timerRequest.user,
9696
room.name());
97-
if (!Objects.equals(room.name(), SMOKETEST_ROOM_NAME)) {
97+
if (!room.name().startsWith(SMOKETEST_ROOM_NAME_PREFIX)) {
9898
stats.incrementBreaktimer(breaktimer);
9999
}
100100
} else {

0 commit comments

Comments
 (0)