Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress Test attempt #1 #909

Open
tomsmith8 opened this issue Jan 10, 2025 · 1 comment
Open

Cypress Test attempt #1 #909

tomsmith8 opened this issue Jan 10, 2025 · 1 comment
Assignees
Labels

Comments

@tomsmith8
Copy link

Output:

describe('User Journey through Sphinx Chat Bounties and Workspace', () => {
  const userAlias = 'alice'; // Assuming 'alice' is the user alias for login

  it('User navigates through the Sphinx Chat platform', () => {
    // Step 1: Navigate to the Bounties page
    cy.visit('https://community.sphinx.chat/bounties');

    // Step 2: User clicks on "Sign in" button
    cy.contains('Sign in').click();

    // Step 3: User clicks on "Login with Sphinx" button
    cy.contains('Login with Sphinx').click();

    // Step 4: User is redirected to a challenge URL
    cy.url().should('include', 'challenge');

    // Step 5: User clicks on a button in the modal
    cy.get('button.euiButton--primary').click();

    // Step 6: User navigates back to the Bounties page
    cy.url().should('eq', 'https://community.sphinx.chat/bounties');

    // Step 7: User clicks on "Bounties Platform" link
    cy.contains('Bounties Platform').click();

    // Step 8: User navigates to the Workspace page
    cy.url().should('include', '/workspace/ck95pe04nncjnaefo08g');

    // Step 9: User clicks on "Workspace Planner" button
    cy.get('[data-testid="workspace-planner-btn"]').click();

    // Step 10: User navigates to the Planner page
    cy.url().should('include', '/planner');

    // Step 11: User clicks on "Unit Tests: UpdateFeatureFlag"
    cy.contains('Unit Tests: UpdateFeatureFlag').click();

    // Step 12: User clicks on "Sign out" button
    cy.contains('Sign out').click();

    // Step 13: User navigates back to the Bounties page
    cy.url().should('eq', 'https://community.sphinx.chat/bounties');

    // Step 14: User returns to the homepage
    cy.visit('https://community.sphinx.chat/');

    // Step 15: User clicks on "Sign in" button again
    cy.contains('Sign in').click();

    // Step 16: User clicks on "Login with Sphinx" button again
    cy.contains('Login with Sphinx').click();

    // Step 17: User is redirected to another challenge URL
    cy.url().should('include', 'challenge');

    // Step 18: User navigates to the Workspaces page
    cy.visit('https://community.sphinx.chat/p/undefined/workspaces');

    // Step 19: User clicks on "Bounties Platform" link again
    cy.contains('Bounties Platform').click();

    // Step 20: User navigates to the Workspace page again
    cy.url().should('include', '/workspace/ck95pe04nncjnaefo08g');

    // Step 21: User clicks on "Workspace Planner" button again
    cy.get('[data-testid="workspace-planner-btn"]').click();

    // Step 22: User navigates to the Planner page again
    cy.url().should('include', '/planner');

    // Step 23: User clicks on "Complete Bounty" button
    cy.contains('Complete Bounty').click();

    // Step 24: User clicks on "Pay Bounty" button
    cy.contains('Pay Bounty').click();

    // Step 25: User clicks on a button in the modal
    cy.get('button.euiButton--primary').click();

    // Step 26: User closes the modal
    cy.get('img[alt="close_svg"]').click();

    // Step 27: User navigates back to the Planner page
    cy.url().should('include', '/planner');

    // Step 28: User clicks on a button to navigate to Workspaces
    cy.get('button.euiButton--primary').click();

    // Step 29: User navigates back to the Bounties page
    cy.url().should('eq', 'https://community.sphinx.chat/bounties');
  });
});
@tomsmith8
Copy link
Author

Attempt 2:

describe('User submits proof after signing in', () => {
  const userAlias = 'alice'; // Assuming 'alice' is the user alias for login

  it('should allow the user to submit proof after signing in', () => {
    // Initial Page Load
    cy.visit('https://community.sphinx.chat/p/cs6elnatu2rsh7eq5hk0/assigned/3324/0');

    // Modal Interaction
    cy.get('[data-testid="close-btn"]').click();

    // Navigation to Another Page
    cy.get('[data-testid="user-personal-bounty-card"]').click();

    // Return to Previous Page
    cy.go('back');

    // Modal Interaction Again
    cy.get('[data-testid="close-btn"]').click();

    // Button Click - Sign In
    cy.contains('Sign in').click();
    cy.login(userAlias);

    // Submit Proof Interaction
    cy.contains('Submit Proof').click();

    // Textarea Interaction
    cy.get('textarea[aria-label="Enter your proof"]').type('Proof text here');

    // Submit Proof Confirmation
    cy.contains('Submit Proof').click();

    // Verify proof submission success
    // Assuming there's a success message or state change to verify
    cy.contains('Proof submitted successfully').should('be.visible');

    // Cleanup
    cy.logout(userAlias);
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants