diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f4aab09..8004d178 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,7 +82,7 @@ jobs: - run: yarn install --immutable --inline-builds - name: Red Team Tests - Chrome v${{ matrix.node }} - uses: cypress-io/github-action@v5.2.0 + uses: cypress-io/github-action@v5.3.1 with: tag: node-${{ matrix.node }} start: yarn start:dev @@ -130,7 +130,7 @@ jobs: git pull origin $GITHUB_HEAD_REF - run: yarn install --immutable --inline-builds - name: 'Blue Team Tests - Chrome' - uses: cypress-io/github-action@v5.2.0 + uses: cypress-io/github-action@v5.3.1 with: tag: node-${{ matrix.node }} start: yarn start:blue diff --git a/.github/workflows/trigger.yml b/.github/workflows/trigger.yml deleted file mode 100644 index 7ef709e2..00000000 --- a/.github/workflows/trigger.yml +++ /dev/null @@ -1,194 +0,0 @@ -name: Cypress Tests - -on: - workflow_dispatch: - inputs: - specs: - description: Comma-separates spec filenames without spaces - required: true - recordingTag: - description: Cypress Dashboard recording tag - required: false - default: Trigger specs - machines: - description: Number of machines to use to run these specs - required: false - type: number - default: 1 - push: - branches: - - main - - develop - pull_request: - branches: - - '**' -jobs: - prepare: - runs-on: ubuntu-20.04 - outputs: - uuid: ${{ steps.uuid.outputs.value }} - steps: - - name: Generate unique ID 💎 - id: uuid - run: echo "{name}={sha-$GITHUB_SHA-time-$(date +"%s")}" >> $GITHUB_ENV - - name: Print unique ID 🖨` - run: echo "generated id ${{ steps.uuid.outputs.value }}" - - name: Print inputs 🖨️ - env: - INPUTS: ${{ toJson(github.event.inputs) }} - run: echo "$INPUTS" - - install: - needs: - - prepare - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - node-version: - - 16.19.0 - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Cache - uses: actions/setup-node@v3 - with: - node-version: 16.19.0 - cache: yarn - - run: | - git fetch - git config pull.rebase true - git pull origin $GITHUB_HEAD_REF - - run: yarn install --immutable --inline-builds - - run: yarn moon run server:build client:build - - name: Save build folder - uses: actions/upload-artifact@v3 - with: - name: moon-cache - path: .moon/cache - if-no-files-found: error - - RedTeamChrome: - needs: - - prepare - - install - strategy: - fail-fast: false - matrix: - containers: - - 1 - - 2 - node-version: - - 16.19.0 - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Cache - uses: actions/setup-node@v3 - with: - node-version: 16.19.0 - cache: yarn - - name: Download the build folders - uses: actions/download-artifact@v3 - with: - name: moon-cache - path: .moon/cache - - run: | - git fetch - git config pull.rebase true - git pull origin $GITHUB_HEAD_REF - - run: yarn install --immutable --inline-builds - - name: Red Team Tests - Chrome v${{ matrix.node }} - uses: cypress-io/github-action@v5.1.0 - with: - tag: node-${{ matrix.node }} - start: yarn start:dev - wait-on: http://localhost:4000/api/graphql, http://localhost:3500 - browser: chrome - group: Red Team - Chrome - config: baseUrl=http://localhost:3500 - record: true - parallel: true - config-file: applications/redeye-e2e/cypress.config.js - spec: applications/redeye-e2e/src/integration/e2e/redteam/**/**/**/*.cy.js - ci-build-id: ${{ needs.prepare.outputs.uuid }} - env: - CYPRESS_PROJECT_ID: rsybgk - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY_RED }} - specs: - - name: Trigger Failed Tests - uses: bahmutov/cypress-workflows/.github/workflows/parallel.yml@v1 - with: - n: ${{ fromJson(github.event.inputs.machines) }} - spec: ${{ github.event.inputs.specs }} - tag: ${{ github.event.inputs.recordingTag }} - group: Selected specs - start: yarn start:dev - wait-on: http://localhost:4000/api/graphql, http://localhost:3500 - ci-build-id: ${{ github.workflow }} - ${{ github.run_id }}-${{ github.run_number - }}-${{ github.run_attempts }} - secrets: - recordKey: ${{ secrets.CYPRESS_RECORD_KEY_RED }} - - BlueTeamChrome: - needs: - - prepare - - install - strategy: - fail-fast: false - matrix: - containers: - - 1 - - 2 - node-version: - - 16.19.0 - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Cache - uses: actions/setup-node@v3 - with: - node-version: 16.19.0 - cache: yarn - - name: Download the build folders - uses: actions/download-artifact@v3 - with: - name: moon-cache - path: .moon/cache - - run: | - git fetch - git config pull.rebase true - git pull origin $GITHUB_HEAD_REF - - run: yarn install --immutable --inline-builds - - name: Blue Team Tests - Chrome - uses: cypress-io/github-action@v5.1.0 - with: - tag: node-${{ matrix.node }} - start: yarn start:blue - wait-on: http://localhost:4000/api/graphql, http://localhost:3500 - browser: chrome - group: Blue Team - Chrome - config: baseUrl=http://localhost:3500 - record: true - parallel: true - config-file: applications/redeye-e2e/cypress.config.js - spec: applications/redeye-e2e/src/integration/e2e/blueteam/**/*.cy.js - ci-build-id: ${{ needs.prepare.outputs.uuid }} - env: - CYPRESS_PROJECT_ID: 46ahz3 - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY_BLUE }} - - specs: - - name: Trigger Failed Tests - uses: bahmutov/cypress-workflows/.github/workflows/parallel.yml@v1 - with: - n: ${{ fromJson(github.event.inputs.machines) }} - spec: ${{ github.event.inputs.specs }} - tag: ${{ github.event.inputs.recordingTag }} - group: Selected specs - start: yarn start:blue - wait-on: http://localhost:4000/api/graphql, http://localhost:3500 - ci-build-id: ${{ github.workflow }} - ${{ github.run_id }}-${{ github.run_number - }}-${{ github.run_attempts }} - secrets: - recordKey: ${{ secrets.CYPRESS_RECORD_KEY_BLUE }} diff --git a/applications/redeye-e2e/src/support/commands.js b/applications/redeye-e2e/src/support/commands.js index f1443b3d..d0685829 100644 --- a/applications/redeye-e2e/src/support/commands.js +++ b/applications/redeye-e2e/src/support/commands.js @@ -123,29 +123,7 @@ Cypress.Commands.add('favoriteComment', (index) => { cy.get('[cy-test=fav-comment]').should('be.visible').eq(index).click({ force: true }); }); -//ADD NEW COMMENT WITH IF-ELSE LOGIC -// Cypress.Commands.add('addNewComment', (index, comment, tag) => { -// cy.get('[cy-test=add-comment]') -// .eq(index) -// .then(($add) => { -// if ($add.is(':visible')) { -// cy.log('NOT NEW COMMENT '); -// cy.wrap($add).click(); -// cy.wait('@tags'); -// cy.get('[cy-test=add-new-comment]').click(); -// cy.get('[cy-test=comment-input]').type(comment).type('{enter}'); -// cy.addTags(tag); -// cy.get('[cy-test=save-comment]').click(); -// cy.wait('@addCommandGroupAnnotation'); -// } else { -// cy.log('NEW COMMENT '); -// cy.addComment(0, comment); -// cy.addTags(tag); -// cy.get('[cy-test=save-comment]').click(); -// cy.wait('@addCommandGroupAnnotation'); -// } -// }); -// }); +//ADD NEW COMMENT Cypress.Commands.add('addNewComment', (index, comment, tag) => { cy.get('[cy-test=command-info]') .eq(index) @@ -217,25 +195,6 @@ Cypress.Commands.add('editExistingComment', (index, editedCommentText) => { cy.wait('@updateAnnotation'); }); -// // Delete files from the Downloads folder -// Cypress.Commands.add('deleteDownloadsFolderContent', () => { -// cy.task('readdir', { dirPath: 'cypress/downloads' }).then((arr) => { -// if (arr.length > 0) { -// cy.log('Found ' + arr.length + ' file(s) in ' + 'cypress/downloads' + ':' + '\n' + arr); -// cy.task('deleteDownloads', { dirPath: 'cypress/downloads' }); -// cy.task('readdir', { dirPath: 'cypress/downloads' }).then((newArr) => { -// if (newArr.length == 0) { -// cy.log('Cleared contents of ' + 'cypress/downloads'); -// } else { -// throw new Error('Did not clear all files from ' + 'cypress/downloads'); -// } -// }); -// } else { -// cy.log('No files were found to delete in ' + 'cypress/downloads'); -// } -// }); -// }); - // Reply to a comment (only adds text, no tags) Cypress.Commands.add('replyToComment', (index, cmt) => { cy.get('[cy-test=reply]').eq(index).click();