Configuring Protractor to customize Safari settings such as adjusting window size

Is there a way to specify the window size in Safari similar to how we set args and prefs in chromeOptions?

I attempted the following setup using Protractor 4.5.1 and Safari 12.0 on Mac:

safari: {
    name: 'Safari',
    browserName: 'safari',
    window_size: 'maximize',
    options:{
        cleanSession: true
    }
}

However, I couldn't get Safari to maximize the window as expected.

Answer №1

Give this a shot:

onPrepare: () => {
    let screenSize = 1920;
    let resolution = 1080;
    browser.manage().window().setSize(screenSize, resolution);
    // Uncomment the line below if you want to maximize it.
    // browser.manage().window().maximize();
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular 14 debug error: Incorrect base path setting

Whenever I go for a run, I have to specify a starting point such as /pis/ ng serve --serve-path /pis/ Even after following these instructions, nothing seems to load. Can anyone lend a hand with setting a starting point in the ng serve process? ...

Display div - conceal div - pause for 15 minutes - continue the cycle

I have a challenging JavaScript task that I've been struggling with for quite some time. The goal is to display a div for 5 seconds, hide it, wait for 15 minutes, then show it again for another 5 seconds, and continue this process in an infinite loop. ...

What is the reason for $addToSet always returning 1 upon update?

Recently, I have been utilizing mongoose for my project. I encountered an issue when attempting to update my data in a specific way. model.update({_id: id}, {$addToSet: {refs: refId}}, function(err, numAffected){ console.log(numAffected); }) Although t ...

Utilizing the onclick event to call a function with multiple arguments within Template literals

How can I properly write a function with multiple arguments using JavaScript post ES6 template literals when called by an onclick event? Here is my code: function displayImg(imageUrl, gameName, gameSummary, gameYear, cardId) { cardId = cardId.toStrin ...

Is there a way to customize a package.json file using postinstall?

I've developed a package on npm that generates an "scss directory structure" and my goal is to include custom scripts in the package.json file located at the project's root. MY-PROJECT ├── node_modules ├── scss └── package.json ...

What is the best way to run two JavaScript functions simultaneously?

Is there a way to run multiple JavaScript AJAX functions concurrently? ...

The functionality of the Regions plugin in wavesurfer.js appears to be completely nonfunctional

I've been attempting to utilize the Regions plugin from wavesurfer.js, but unfortunately, it's not functioning as expected. Despite trying various methods suggested on different websites, I have yet to achieve success. Below is the snippet of c ...

Issue with TinyMCE Editor: Inoperative

<script type="text/javascript" src="<your installation path>/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", theme: "modern", plugins: [ "advlist autolink li ...

The mock service is not being utilized, while the genuine service is successfully injected

I have a question regarding testing a controller that relies on a service. During my test, I noticed that the actual service is being injected instead of the mock service that I defined using $provider.factory. Can anyone explain why this might be happen ...

Encountering an issue while setting up a new React application on Windows using npx

While attempting to create a React app with NODE (current version: 18.9.0) installed on my computer, I keep encountering errors. npx create-react-app my-app-one The error message reads as follows: C:\Users\MyName\Documents\React>npx ...

Arranging data entries and subsequently utilizing the updateMany function in MongoDB within a specified limit

I have been attempting to update all entries in my MongoDB database by sorting them in ascending order based on the date (updatedAt) and then updating a limited quantity of records according to their current status (currentStatus). Here are the fields inv ...

Unlocking new possibilities with Passport.js - sharing tokens across multiple servers

Currently, I am utilizing passport.js and MongoDB to handle user login and postAPI authentications. However, every time I deploy my node server to a different AWS instance, I find myself having to go through the signup process, log in, and obtain a new tok ...

Navigate to the location using AngularJS elements in the JavaScript iframe1

Dealing with an issue while working on AngularJS. I am facing a frustrating problem where I am attempting to use one link to open links in two separate iframes. All aspects of this function correctly, except for the actual links. The issue arises when usin ...

The initial result from reactQuery may start off as undefined, but eventually it will provide the data as

Currently, I am working on fetching data using reactQuery and storing the response in a variable when clicked. const { data: response, refetch } = useQuery({ queryKey: ['get-response'], queryFn: async() => { return await Axios ...

Is there a way to export a specific portion of a destructuring assignment?

const { a, ...rest } = { a: 1, b: 2, c: 3 }; If I want to export only the rest object in TypeScript, how can I achieve that? ...

Error in Redux reducer file caused by an incorrect data type in action.payload

I have encountered a type error in my reducers' file where it says that my 'Property 'address' does not exist on type 'number | { connection: boolean; address: string; }'. This issue is arising in my React application while us ...

Angular, perplexed by the output displayed in the console

I'm completely new to Angular and feeling a bit lost when it comes to the console output of an Angular app. Let me show you what I've been working on so far! app.component.ts import { Component } from '@angular/core'; @Component({ ...

Create buttons to increase or decrease values using Bootstrap and JavaScript

What is the proper way to make this button function properly? I tested adding this line of javascript code, however it prompts an alert without clicking on the buttons as well. document.querySelector(".btnminus").addEventListener(onclick,ale ...

Creating a clickable cell within a table utilizing an Angular directive

Looking for someone with experience in AngularJS directives and jQuery to help me out. I have a simple table displayed and I want users to be able to select any cell by clicking on it, and then navigate using the keyboard. Any ideas on how to achieve thi ...

Transforming each element of an observable array by updating their properties with data retrieved from an ajax request using knockout

In my ViewModel "AppViewModel", I am fetching JSON data to create the model. One of the properties, "totalSessions", requires an ajax call to be fetched. While my code runs without errors, the view does not update as expected. var jsonapparray = []; ...