add a step to check that the link station button works
这个提交包含在:
		
							父节点
							
								
									6c06956e9a
								
							
						
					
					
						当前提交
						f619a6b702
					
				
					共有  1 个文件被更改,包括 39 次插入 和 0 次删除
				
			
		|  | @ -4,6 +4,7 @@ describe("Create station logbook", () => { | |||
| 	}); | ||||
| 
 | ||||
| 	it("should load an empty list of station locations", () => { | ||||
| 		// Navigate to the logbooks page
 | ||||
| 		cy.visit("/index.php/logbooks"); | ||||
| 
 | ||||
| 		// Check that the table is not present
 | ||||
|  | @ -11,6 +12,7 @@ describe("Create station logbook", () => { | |||
| 	}); | ||||
| 
 | ||||
| 	it("should have a button to create a new station location", () => { | ||||
| 		// Navigate to the logbooks page
 | ||||
| 		cy.visit("/index.php/logbooks"); | ||||
| 
 | ||||
| 		// Check that the button is present
 | ||||
|  | @ -20,6 +22,7 @@ describe("Create station logbook", () => { | |||
| 	}); | ||||
| 
 | ||||
| 	it("should create a new station location", () => { | ||||
| 		// Navigate to the create logbook page
 | ||||
| 		cy.visit("/index.php/logbooks/create"); | ||||
| 
 | ||||
| 		// Define the station location name
 | ||||
|  | @ -41,4 +44,40 @@ describe("Create station logbook", () => { | |||
| 			.contains(stationLogbookName) | ||||
| 			.should("exist"); | ||||
| 	}); | ||||
| 
 | ||||
| 	it("should set as active station logbook when button clicked", () => { | ||||
| 		// Navigate to the logbooks page
 | ||||
| 		cy.visit("/index.php/logbooks"); | ||||
| 
 | ||||
| 		// Check that the button is present
 | ||||
| 		cy.get("a").contains("Set as Active Logbook").should("exist").click(); | ||||
| 
 | ||||
| 		// Check if the station was set to active
 | ||||
| 		cy.get("body") | ||||
| 			.contains("Active Logbook") | ||||
| 			.should("be.visible") | ||||
| 			.and("have.class", "badge text-bg-success"); | ||||
| 	}); | ||||
| 
 | ||||
| 	it("should link to a station location from the edit logbook page", () => { | ||||
| 		// Navigate to the logbooks page
 | ||||
| 		cy.visit("/index.php/logbooks"); | ||||
| 
 | ||||
| 		// Click the edit button
 | ||||
| 		cy.get("i.fas.fa-edit").should("exist").click(); | ||||
| 
 | ||||
| 		// Ensure that the edit link navigates to the correct page
 | ||||
| 		cy.url().should("include", "/logbooks/edit"); | ||||
| 
 | ||||
| 		// Scroll to the bottom of the page
 | ||||
| 		cy.scrollTo("bottom"); | ||||
| 
 | ||||
| 		// Click the link location button
 | ||||
| 		cy.get("button").contains("Link Location").should("exist").click(); | ||||
| 
 | ||||
| 		// Make sure that our table now shows the linked station location
 | ||||
| 		cy.get("#station_logbooks_linked_table") | ||||
| 			.contains("Test Station Location") | ||||
| 			.should("exist"); | ||||
| 	}); | ||||
| }); | ||||
|  |  | |||
		正在加载…
	
		在新工单中引用