首页 > protractor是不是可以用jasmine里的所有方法?

protractor是不是可以用jasmine里的所有方法?

我看到有些protractor的demo,出现了expect().toMatch(),expect().toBe(),而protractor的API里没有这2个方法,这2个方法貌似是jasmine的。
所以,我的疑问是,是不是jasmine的所有方法protractor都可以用?

describe('HealthSense POC Grid', function() {
         beforeEach(function() {
           browser.get('http://Your Application URL');
            ptor = protractor.getInstance();
           });
  
        it('should click on the grid link', function() {
               element(by.xpath('//a[contains(text(),"Grid")]')).click();
           expect(element(by.xpath('//h1')).getText()).toEqual('Master Grid');
           });
            
        it('should enter ID in filter', function() {
                   ptor.actions().sendKeys(protractor.Key.HOME).perform();
          element(by.model('Model.ID')).sendKeys('10');
          results = element.all(by.repeater('value in testValues'));
               expect(results.count()).toEqual(5);
           element(by.model('Model.ID')).clear();
          ptor.actions().sendKeys(protractor.Key.SPACE).perform();
        });
            
        it('should change the number of records per page to 10', function(){
           element(by.xpath('//select')).click();
            element(by.css('option[value="10"]')).click();
            results1 = element.all(by.repeater('value in testValues'));
          expect(results1.count()).toEqual(10);
        });
});
【热门文章】
【热门文章】