test(docs-infra): fix and enable remaining component-interaction e2e tests (#39001)
				
					
				
			Previously, some of the e2e tests of the `component-interaction` docs example were disabled because they were failing. This commit fixes and re-enables them. PR Close #39001
This commit is contained in:
		
							parent
							
								
									2df39ee338
								
							
						
					
					
						commit
						53a7ed4317
					
				| @ -145,19 +145,25 @@ describe('Component Communication Cookbook Tests', () => { | ||||
|     // #enddocregion child-to-parent
 | ||||
|   }); | ||||
| 
 | ||||
|   // Can't run timer tests in protractor because
 | ||||
|   // interaction w/ zones causes all tests to freeze & timeout.
 | ||||
|   xdescribe('Parent calls child via local var', () => { | ||||
|   describe('Parent calls child via local var', () => { | ||||
|     countDownTimerTests('app-countdown-parent-lv'); | ||||
|   }); | ||||
| 
 | ||||
|   xdescribe('Parent calls ViewChild', () => { | ||||
|   describe('Parent calls ViewChild', () => { | ||||
|     countDownTimerTests('app-countdown-parent-vc'); | ||||
|   }); | ||||
| 
 | ||||
|   function countDownTimerTests(parentTag: string) { | ||||
|     // #docregion countdown-timer-tests
 | ||||
|     // ...
 | ||||
|     // The tests trigger periodic asynchronous operations (via `setInterval()`), which will prevent
 | ||||
|     // the app from stabilizing. See https://angular.io/api/core/ApplicationRef#is-stable-examples
 | ||||
|     // for more details.
 | ||||
|     // To allow the tests to complete, we will disable automatically waiting for the Angular app to
 | ||||
|     // stabilize.
 | ||||
|     beforeEach(() => browser.waitForAngularEnabled(false)); | ||||
|     afterEach(() => browser.waitForAngularEnabled(true)); | ||||
| 
 | ||||
|     it('timer and parent seconds should match', async () => { | ||||
|       const parent = element(by.tagName(parentTag)); | ||||
|       const startButton = parent.element(by.buttonText('Start')); | ||||
| @ -165,7 +171,9 @@ describe('Component Communication Cookbook Tests', () => { | ||||
|       const timer = parent.element(by.tagName('app-countdown-timer')); | ||||
| 
 | ||||
|       await startButton.click(); | ||||
|       await browser.sleep(10); // give `seconds` a chance to catchup with `timer`
 | ||||
| 
 | ||||
|       // Wait for `<app-countdown-timer>` to be populated with any text.
 | ||||
|       await browser.wait(() => timer.getText(), 2000); | ||||
| 
 | ||||
|       expect(await timer.getText()).toContain(await seconds.getText()); | ||||
|     }); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user