暂无描述

alerts.spec.js 619B

123456789101112131415161718192021
  1. import { test } from '../restFixture.js';
  2. import { expect } from '@playwright/test';
  3. import crypto from 'node:crypto';
  4. test.beforeEach(async({ page }) => {
  5. await page.goto('/alerts');
  6. });
  7. test('should present the alert', async ({ page, rest }) => {
  8. const alertTitle = `Alert - ${crypto.randomUUID()}`;
  9. let response = await rest.post('/alerts/add', {
  10. data: {
  11. alert_title: alertTitle,
  12. alert_severity_id: 4,
  13. alert_status_id: 3,
  14. alert_customer_id: 1
  15. }
  16. });
  17. await expect(page.getByRole('heading', { name: alertTitle })).toBeVisible();
  18. });