-
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.
- Loading branch information
Showing
23 changed files
with
319 additions
and
159 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: run-e2e-ui-starter | ||
run-name: Checking UI Starter | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
branches: | ||
- main | ||
schedule: | ||
# Run at 00:25 and 12:25 on saturday and sunday | ||
- cron: '25 0,12 * * 0,6' | ||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
# Run ui-starter | ||
- run: | | ||
git clone https://github.com/nuclia/ui-starter.git | ||
cd ./ui-starter | ||
npm install | ||
npm run missdev | ||
npm run build | ||
npm run preview & | ||
# Install npm dependencies, cache them correctly and run all Cypress tests | ||
- name: Cypress run | ||
id: cypress | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
install-command: yarn install | ||
spec: cypress/e2e/5-ui-starter/ui-starter.cy.js | ||
env: | ||
CYPRESS_BASE_URL: https://stashify.cloud | ||
CYPRESS_BEARER_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
CYPRESS_NUA_KEY: ${{ secrets.NUA_KEY }} | ||
CYPRESS_USER_NAME: ${{ secrets.USER_NAME }} | ||
CYPRESS_USER_PWD: ${{ secrets.USER_PWD }} | ||
CYPRESS_RUNNING_ENV: stage | ||
CYPRESS_UI_STARTER: true | ||
# after the test run completes store reports and any screenshots | ||
- name: Cypress reports | ||
id: report | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ failure() && steps.cypress.conclusion == 'failure' }} | ||
with: | ||
name: cypress-reports | ||
path: cypress/reports | ||
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | ||
- name: Slack notification | ||
id: slack | ||
uses: slackapi/[email protected] | ||
if: ${{ failure() && steps.cypress.conclusion == 'failure' && github.ref_name == 'main' }} | ||
with: | ||
payload: | | ||
{ | ||
"text": "⚠️ UI Starter E2E failed\nTriggered by ${{ github.triggering_actor }} \nRun #${{ github.run_number }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nCypress report: ${{ steps.report.outputs.artifact-url }}" | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_HOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import { UI_STARTER } from '../../support/common'; | ||
|
||
describe('UI Starter', () => { | ||
it('should build UI Starter', () => { | ||
if (!UI_STARTER) { | ||
cy.log('Not the UI Starter environment'); | ||
cy.on('fail', (err, runnable) => { | ||
cy.log(err.message); | ||
return false; | ||
}); | ||
cy.request({ url: 'http://localhost:4173', failOnStatusCode: false }).should('be.false'); | ||
} else { | ||
cy.visit('http://localhost:4173'); | ||
cy.get('.nuclia-widget .sw-search-input').should('exist'); | ||
cy.get('.sw-textarea textarea').click(); | ||
cy.get('.sw-textarea textarea').type(`Gold price evolution in 2023\n`, { force: true }); | ||
cy.get('.sw-initial-answer').should('exist'); | ||
cy.get('h3.result-title').should('exist'); | ||
} | ||
}); | ||
}); |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.