Scenario steps move to cypress/scenarios/ and each gets a thin spec in cypress/e2e/, so the same steps can back more than one spec. Shared phones move to cypress/support/phones.ts, and "Run all specs" is enabled in the Cypress UI for playing every scenario back to back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
889 B
TypeScript
17 lines
889 B
TypeScript
import { defineScenario, tid } from '../support/e2e';
|
|
import { alice, maria, james } from '../support/phones';
|
|
|
|
export default defineScenario('closes on the deadline and awards whoever did bid', () => {
|
|
cy.resetDispatch({ auctionDurationMs: 4000 });
|
|
cy.openPhones([alice, maria, james]);
|
|
cy.requestRide('alice', 'ferry', 'Ferry Building');
|
|
|
|
cy.bid('maria', 10.75);
|
|
// James never answers; the auction stays open until the window runs out.
|
|
cy.phone('alice').find(tid('ride-status')).should('have.text', 'Finding your driver');
|
|
|
|
cy.phone('alice').find(tid('ride-status'), { timeout: 8000 }).should('have.text', 'Driver found');
|
|
cy.phone('alice').find(tid('ride-fare')).should('have.text', '$10.75');
|
|
cy.phone('james').find(tid('driver-result')).should('have.text', 'That request closed before you answered');
|
|
cy.phone('james').find(tid('offer')).should('not.exist');
|
|
});
|