|
| 1 | +describe('Dependency Injection', function () { |
| 2 | + |
| 3 | + beforeAll(function () { |
| 4 | + browser.get(''); |
| 5 | + }); |
| 6 | + |
| 7 | + it('should render DI samples', function () { |
| 8 | + var loggedInUser = element.all(by.xpath('//h3[text()="Logged in user"]')).get(0); |
| 9 | + expect(loggedInUser).toBeDefined(); |
| 10 | + |
| 11 | + loggedInUser = element.all(by.xpath('//div[text()="Name: Bombasto"]')).get(0); |
| 12 | + expect(loggedInUser).toBeDefined(); |
| 13 | + |
| 14 | + var sortedHeroes = element.all(by.xpath('//h3[text()="Sorted Heroes" and position()=1]')).get(0); |
| 15 | + expect(sortedHeroes).toBeDefined(); |
| 16 | + |
| 17 | + var sortedHero = element.all(by.xpath('//sorted-heroes/[text()="Mr. Nice" and position()=2]')).get(0); |
| 18 | + expect(sortedHero).toBeDefined(); |
| 19 | + |
| 20 | + sortedHero = element.all(by.xpath('//sorted-heroes/[text()="RubberMan" and position()=3]')).get(0); |
| 21 | + expect(sortedHero).toBeDefined(); |
| 22 | + |
| 23 | + sortedHero = element.all(by.xpath('//sorted-heroes/[text()="Magma"]')).get(0); |
| 24 | + expect(sortedHero).toBeDefined(); |
| 25 | + |
| 26 | + var heroOfTheMonth = element.all(by.xpath('//h3[text()="Hero of the month"]')).get(0); |
| 27 | + expect(heroOfTheMonth).toBeDefined(); |
| 28 | + |
| 29 | + var heroBios = element.all(by.xpath('//h3[text()="Hero Bios"]')).get(0); |
| 30 | + expect(heroBios).toBeDefined(); |
| 31 | + |
| 32 | + var magmaText = element.all(by.xpath('//textarea[text()="Hero of all trades"]')).get(0); |
| 33 | + expect(magmaText).toBeDefined(); |
| 34 | + |
| 35 | + var magmaPhone = element.all(by.xpath('//div[text()="Phone #: 555-555-5555"]')).get(0); |
| 36 | + expect(magmaPhone).toBeDefined(); |
| 37 | + |
| 38 | + var runnersUp = element.all(by.xpath('//h4[text()="Other candidates RubberMan, Mr. Nice"]')).get(0); |
| 39 | + expect(runnersUp).toBeDefined(); |
| 40 | + }); |
| 41 | +}); |
0 commit comments