以下のような分度器検査があります。それは正常に動作します。しかし、私のテストはグリッドタイルのピクセル位置に敏感なので、ブラウザをフルスクリーンに開くコードをいくつか追加する必要があります。これはどうすればできますか?分度器テストを実行する前にブラウザのサイズを設定するにはどうすればよいですか?
describe('DragAndDrop Test', function() {
require('protractor');
require('jasmine-expect');
beforeAll(function() {
context = new Context();
context.get();
browser.waitForAngular();
browser.driver.manage().window().maximize();
});
it('should drag and drop Application Experience tile', function() {
//a = angular.element(document).find('h3')[1]
//target is where we are dragging the box to. Box is the Box
var target = { x: 300, y: 50 };
var box = element(by.cssContainingText('h3', 'Application Experience'));
var infoSpot = element(by.cssContainingText('h3', 'Application Experience'));
//scope is going to hold the scope variables that tell us where the box is located
//get the standardItems Scope
box.evaluate('dashboards').then(function(scope) {
//make sure the box we are using is initially set in column 0 and Row 0
expect(scope['1'].widgets[0].col).toEqual(0);
expect(scope['1'].widgets[0].row).toEqual(0);
});
//drag and drop the box somewhere else.
browser.actions().dragAndDrop(box, target).perform();
browser.waitForAngular();
browser.driver.sleep(5000);
//get the updated scope
box.evaluate('dashboards').then(function(scope) {
//test to see that the box was actually moved to column 1 and row 0
expect(scope['1'].widgets[0].col).toEqual(1);
expect(scope['1'].widgets[0].row).toEqual(0);
});
});
});
var Context = function() {
this.ignoreSynchronization = true;
//load the website
this.get = function() {
browser.get('http://127.0.0.1:57828/index.html#/dashboard');
};
};