Error: The protractor module is not defined, please check the stack

I'm currently experimenting with AngularJS tests using Protractor. Here is the stacktrace I have at the moment:

Starting selenium standalone server...
Selenium standalone server started at http://192.168.0.150:51197/wd/hub
F

Failures:

  1) E2E: The Dashboard : Main Page should have a working dashboard
   Message:
     timeout: timed out after 5000 msec waiting for spec to complete
   Stacktrace:
     undefined

Finished in 5.659 seconds
1 test, 1 assertion, 1 failure

Shutting down selenium standalone server. Here is my spec.js file:

describe('E2E: Open Login Page', function() {
  var driver = browser.driver;
  driver.get('http://localhost:8080/accounts/login/?next=/dashboard/')
  driver.findElement(By.name("username")).sendKeys("user");
  driver.findElement(By.name("password")).sendKeys('password');
  //driver.findElement(By.xpath("\\button[]")
  driver.findElement(By.xpath("//button[contains(text(), 'Login')]")).click();
});

describe('E2E: The Dashboard', function() {
  var ptor = protractor.getInstance();

  describe(': Main Page', function() {
    it('should have a working dashboard', function() {
      ptor.get('/dashboard/#/');
      expect(ptor.getTitle()).toContain('Dashboard');
    })
  })
});

Can anyone help me figure out what I'm doing wrong? Any assistance would be greatly appreciated.

Answer №1

Ensure that your application is running at http://localhost:8080. Protractor handles the selenium server but not the application server itself.

If you need to complete everything in one session, try a command like this:

nohup bash -c "RAILS_ENV=test bundle exec rails s &";

This will launch your server (in this case a Rails test server) and save the output to nohup.out. Make sure to add a sleep after this command to allow time for the application server to start before initiating the protractor tests.

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

Issues with the functionality of materials in three.js causing lighting problems

After much experimentation, I am still struggling to achieve a normal shadow using Spot and Directional lights with Lambert and Phong materials: Take a look at some examples When using Spot Light with Lambert Material, the material does not react to ligh ...

Skipping $state.go in AngularJS UI-Router

My AngularJs application is designed to navigate to the login page if the user is not logged in and attempts to access a route that requires authentication. if ($localStorage.globals.access_token) { $rootScope.globals = $localStorage.globals; $sta ...

Exploring the integration of Mariadb COLUMN_JSON data in JavaScript

I am encountering difficulties while attempting to access COLUMN_JSON data in JavaScript. I referred to a MariaDB JSON example and inserted it into a table with the following query: UPDATE myTable SET myJsonColumn = COLUMN_CREATE('color', ' ...

JS: Looking to add animation with a button click?

Looking for feedback on my code to animate/colorify the div when clicking the 'Animate' button. Any suggestions or additional code are welcome! This is how my code currently looks: .anime { animation: coloranimate 5s; width: 100px; heig ...

What is the reason for including $scope in the dependencies array of a controller?

I have noticed that many people, including the Angular documentation, define controllers in this way: app.controller('ExampleController', [$scope, $http, function($scope, $http) { $scope.name = "Bob"; }]); Why is it necessary to include $sc ...

The light/dark mode toggle is a one-time use feature

I've been experimenting with creating a button to toggle between light and dark modes on my website. Initially, it's set to light mode, but when I try switching to dark mode, it works fine. However, the issue arises when attempting to switch back ...

Emphasizing all words within a given set of characters

I am interested in modifying a string by making all the words enclosed in brackets bold using JSX. I have a working solution, but I am curious if there is a more efficient way to achieve this. const jsxArray = []; let unformattedString = "[name] Hi th ...

I attempted to make changes to a Firebase document using the update() function, however, the document did not reflect

I am currently in the process of creating a blog and have been focusing on implementing an edit post feature. However, I have encountered an issue where when I utilize the ref.update() method, it indicates that the update was successful but I do not see an ...

unnecessary files in the node_modules directory in Rails

I am a beginner in Node.js and unfamiliar with npm and modular JavaScript. After using the browserify-rails gem, I noticed that there are multiple files from a GitHub repo stored in the node_modules folder after running npm install. Since I only require ...

Opening new windows in Chrome after an AJAX request behaves like a pop-up

When a user clicks a button in my application, an ajax request is triggered. Following the success of this request, I generate a URL which I intend to open in a new tab. Unfortunately, when using Chrome and calling window.open within the success handler, t ...

The option to Generate Step Definition in Specflow is absent from the context menu

When I right click on my feature file, I expect to see the option to Generate step definitions in the context menu. However, it is not appearing. After conducting a search, I found information suggesting that I need to install SpecRun for NUnit. I proceede ...

Can you explain the meaning of the code provided below?

I'm having trouble understanding the functionality of this code snippet: .bind(this); (I copied it from the Zurb Foundation dropdown plugin) .on('mouseleave.fndtn.dropdown', '[data-dropdown], [data-dropdown-content]', function ( ...

Issue with webpack-dev-server causing it to not reload and build automatically due to configuration error

Currently in my project, I am utilizing the following versions: "webpack": "2.2.1", "webpack-dev-server": "2.4.2" I am looking to create an application that can automatically rebuild when a file is changed using webpack-dev-server live reloading. Within ...

Issues with triggering the Service Worker "install" event on Firefox but working on Chrome

As I delve into the world of service workers, I decided to create a simple one for testing purposes. To my surprise, it seems to work flawlessly on Chrome, but encounters issues on Firefox. Here is the content of my sw.js file (served from the root folder ...

Spinning Loader in ui-select AngularJS

Currently, I am working with AngularJs and the ui-select plugin from ui-select. My goal is to implement a spinner while fetching data from the server. How can I integrate a spinner directly into the HTML code? The following snippet shows the existing HTML ...

How to use a jQuery each loop to retrieve the margin of an element

I currently have 7 different elements, each with unique margin-left and margin-top properties set in the CSS file. I am looking to loop through these elements and gather information about their margins. This is what my jQuery code looks like so far: var ...

A notification appears when the record is being inserted after clicking the button

Just venturing into the PHP and MYSQL realm, so please excuse any beginner questions. Before I submit data from a form to my SQL table, I'd like to display a confirmation POP UP message asking "Are you sure you want to insert this data?" ...

The XMLHttpRequest is displaying additional characters within its response

Upon completing an XMLHttpRequest(), I am receiving the unexpected output of "true↵↵↵". In my php file, all I have is echo json_encode(true); Can anyone shed some light on why this strange behavior is occurring? Thank you ...

Navigating to the initial tab with Selenium Web Driver in Java

I'm currently using Selenium WebDriver with Java to automate a feature where clicking on a link opens a new tab. My goal is to create a global method to handle switching between tabs. I have a separate method for performing assertions on the second ta ...

Exploring ways to specifically select predefined strings by defining a regex parameter in angular-ui-router

I need to restrict access to a specific state in my angular-ui-router based on the parameter being one of the following strings: "site1" "site2" "site3" Here is my current state configuration: $stateProvider.state("error", { url: '/error/{sub: ...