|
@@ -0,0 +1,46 @@
|
|
|
+import LoginPage from '../../support/pageObjects/LoginPage';
|
|
|
+import MainPage from '../../support/pageObjects/MainPage';
|
|
|
+import WorklistPage from '../../support/pageObjects/WorklistPage';
|
|
|
+
|
|
|
+
|
|
|
+describe('Exam Page Navigation', () => {
|
|
|
+ const loginPage = new LoginPage();
|
|
|
+ const mainPage = new MainPage();
|
|
|
+ const worklistPage = new WorklistPage();
|
|
|
+
|
|
|
+ beforeEach(() => {
|
|
|
+ loginPage.visit();
|
|
|
+ loginPage.getUsernameInput().should('be.visible');
|
|
|
+ loginPage.getPasswordInput().should('be.visible');
|
|
|
+ loginPage.getSubmitButton().should('be.visible');
|
|
|
+ });
|
|
|
+
|
|
|
+ it('应该检查到ready', () => {
|
|
|
+ loginPage.login('admin', '123456');
|
|
|
+ cy.contains('登录成功').should('be.visible', { timeout: 10000 });
|
|
|
+
|
|
|
+ //mainPage.clickExamButton();
|
|
|
+ // cy.url().should('include', '/exam');
|
|
|
+ //cy.wait(3000);
|
|
|
+ mainPage.clickPatientManagementButton();
|
|
|
+ mainPage.clickWorklistButton();
|
|
|
+ worklistPage.findTableAndDoubleClickFirstRow();
|
|
|
+ cy.wait(3000);
|
|
|
+ // mainPage.getHomeButton().click();
|
|
|
+ // cy.url().should('include', '/main');
|
|
|
+ cy.task('mqttPublish', {
|
|
|
+ broker: 'ws://192.168.1.60:8083/mqtt',
|
|
|
+ topic: 'MODULE/TASK/STATUS/GLOBAL',
|
|
|
+ payload: JSON.stringify({
|
|
|
+ GENStatus: "GENERATOR_STATUS_STANDBY",
|
|
|
+ GENReady: true,
|
|
|
+ FPDStatus: "DETECTOR_STATUS_STANDBY",
|
|
|
+ FPDReady: true,
|
|
|
+ InspStatus: "TASK_Ready",
|
|
|
+ InspReady: true,
|
|
|
+ AllReady: true
|
|
|
+ })
|
|
|
+ });
|
|
|
+ cy.get('button[data-testid="device-all-ready"]').should('have.class', 'text-green-500');
|
|
|
+ });
|
|
|
+});
|