Skip to content

Commit

Permalink
Merge pull request #1996 from stakwork/bugfix/revert-e2e-fix
Browse files Browse the repository at this point in the history
Revert "Merge pull request #1993 from saithsab877/cyress-test"
  • Loading branch information
Rassl authored Aug 5, 2024
2 parents 864d583 + b9895ff commit 53267ca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 40 deletions.
14 changes: 7 additions & 7 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-directory ./stack up -d;
STAKWORK_TOKEN=daaa3a0894f0658d99781471dfccd3e1 TWITTER_BEARER=$TWITTER_BEARER GITACTION_ENV=gitactionenv docker-compose -f ./stack/alts/navfiber.yml --project-dir ./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 All @@ -104,4 +104,4 @@ jobs:

- name: Stop Stack
working-directory: ./stack
run: docker compose down
run: docker-compose down
16 changes: 5 additions & 11 deletions cypress/e2e/addContent/addTweet.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@ describe('Add Tweet Content', () => {
it('Carol adds tweet content to graph', () => {
cy.initialSetup('carol', 300)

cy.intercept(
{
method: 'POST',
url: 'http://localhost:8444/api/add_node*',
},
{
statusCode: 200,
body: { success: true },
},
).as('addTweet')
cy.intercept({
method: 'POST',
url: 'http://localhost:8444/api/add_node*',
}).as('addTweet')

cy.get('[data-testid="add-content-modal"]').click()

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')
Expand Down
16 changes: 5 additions & 11 deletions cypress/e2e/addContent/addWebpage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@ describe('Add Webpage Content', () => {
it('Carol adds webpage to graph', () => {
cy.initialSetup('carol', 50)

cy.intercept(
{
method: 'POST',
url: 'http://localhost:8444/api/add_node*',
},
{
statusCode: 200,
body: { success: true },
},
).as('addWebpage')
cy.intercept({
method: 'POST',
url: 'http://localhost:8444/api/add_node*',
}).as('addWebpage')

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="skip-location-btn"').click()
cy.get('[data-testid="check-icon"]').click()

cy.wait('@addWebpage')
Expand Down
16 changes: 5 additions & 11 deletions cypress/e2e/addContent/addYoutube.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@ describe('Add Youtube Content', () => {
it('Carol adds youtube video to graph', () => {
cy.initialSetup('carol', 50)

cy.intercept(
{
method: 'POST',
url: 'http://localhost:8444/api/add_node*',
},
{
statusCode: 200,
body: { success: true },
},
).as('addYoutube')
cy.intercept({
method: 'POST',
url: 'http://localhost:8444/api/add_node*',
}).as('addYoutube')

cy.get('[data-testid="add-content-modal"]').click()
cy.get('#addContent').should('exist')
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')
Expand Down

0 comments on commit 53267ca

Please sign in to comment.