Skip to content

Commit

Permalink
fix(cypress): test
Browse files Browse the repository at this point in the history
  • Loading branch information
saithsab877 committed Aug 4, 2024
1 parent 3b14331 commit 241096b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Clone Stack
run: |
git clone https://github.com/stakwork/sphinx-stack.git stack
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
command: |
export TWITTER_BEARER="Bearer ${{ secrets.TWITTER_BEARER }}"
echo $TWITTER_BEARER
STAKWORK_TOKEN=daaa3a0894f0658d99781471dfccd3e1 TWITTER_BEARER=$TWITTER_BEARER GITACTION_ENV=gitactionenv docker-compose -f ./stack/alts/navfiber.yml --project-dir ./stack up -d;
STAKWORK_TOKEN=daaa3a0894f0658d99781471dfccd3e1 TWITTER_BEARER=$TWITTER_BEARER GITACTION_ENV=gitactionenv docker compose -f ./stack/alts/navfiber.yml --project-directory ./stack up -d;
sleep 240;
docker ps
docker logs meme.sphinx
Expand All @@ -67,8 +67,8 @@ jobs:
- name: Copy Node.json
uses: canastro/copy-file-action@master
with:
source: "stack/relay/NODES.json"
target: "relay/nodes.json"
source: 'stack/relay/NODES.json'
target: 'relay/nodes.json'

- name: Install
run: yarn --immutable
Expand All @@ -80,7 +80,7 @@ jobs:
install-command: yarn --immutable
browser: chrome
start: yarn run start-e2e
wait-on: "http://localhost:3000" # Waits for above
wait-on: 'http://localhost:3000' # Waits for above
wait-on-timeout: 120 # Waits for 2 minutes
# Records to Cypress Dashboard
record: true
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/addContent/addTweet.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ describe('Add Tweet Content', () => {
cy.get('#addContent').should('exist')
cy.get('[id="cy-youtube-channel-id"]').type('https://twitter.com/ijbguy/status/1771096005162729663')
cy.get('[data-testid="add-content-btn"]').click()
cy.get('[data-testid="skip-location-btn"').click()
cy.get('[data-testid="skip-location-btn"]').click()
cy.get('[data-testid="check-icon"]').click()

cy.wait('@addTweet')
cy.wait(5500) // This is because add source is currently skipped,
cy.wait(5000)
cy.get('.Toastify__toast-body').should('have.text', 'Content Added')
cy.get('#addContent').should('not.exist')
// cy.get('#addContent').should('not.exist')
})
})
8 changes: 4 additions & 4 deletions cypress/e2e/addContent/addWebpage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ describe('Add Webpage Content', () => {
cy.get('[data-testid="add-content-modal"]').click()
cy.get('#addContent').should('exist')
cy.get('[id="cy-youtube-channel-id"]').type('https://www.netflix.com/browse')
cy.wait(1000)
cy.get('[data-testid="add-content-btn"]').should('not.be.disabled').click()
cy.get('[data-testid="skip-location-btn"').click()
cy.get('[data-testid="add-content-btn"]').click()
cy.get('[data-testid="skip-location-btn"]').click()
cy.get('[data-testid="check-icon"]').click()

cy.wait('@addWebpage')
cy.wait(5000)
cy.get('.Toastify__toast-body').should('have.text', 'Content Added')
cy.get('#addContent').should('not.exist')
// cy.get('#addContent').should('not.exist')
})
})
5 changes: 3 additions & 2 deletions cypress/e2e/addContent/addYoutube.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ describe('Add Youtube Content', () => {
cy.get('[id="cy-youtube-channel-id"]').type('https://www.youtube.com/watch?v=dPLPSaFqJmY')
cy.wait(1000)
cy.get('[data-testid="add-content-btn"]').should('not.be.disabled').click()
cy.get('[data-testid="skip-location-btn"').click()
cy.get('[data-testid="skip-location-btn"]').click()
cy.get('[data-testid="check-icon"]').click()

cy.wait('@addYoutube')
cy.wait(5000)
cy.get('.Toastify__toast-body').should('have.text', 'Content Added')
cy.get('#addContent').should('not.exist')
// cy.get('#addContent').should('not.exist')
})
})

0 comments on commit 241096b

Please sign in to comment.