UNPKG

cypress-pause

Version:

A Cypress plugin that adds a Pause & Resume button to the test runner UI.

23 lines (19 loc) 542 B
import React, { useState } from 'react'; export default function PauseResumeButton() { const [isPaused, setIsPaused] = useState(false); function togglePause() { if (isPaused) { Cypress.emit('resume:tests'); // Resume execution } else { Cypress.emit('pause:tests'); // Pause execution } setIsPaused(!isPaused); } return ( <button onClick={togglePause} className="bg-red-500 text-white px-4 py-2 rounded"> {isPaused ? 'Resume' : 'Pause'} </button> ); }