-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nightwatch File Structure #40
Comments
@mnielsen22 have you followed the instructions and folder structure laid out in this repo/tutorial ? |
@nelsonic - Yes, I have followed the instructions. I felt that the file structure was unclear. Specifically the files and questions that I mentioned above. |
@mnielsen22 the "file structure" is up to you. but what works for us is:
You would have
your
you can put your tests _anywhere_ you like as long as you reflect that location in your
|
When i started nightwatch.. i faced similar issue. To set up file structure seems very unclear even from the nightwatch website and as @nelsonic mentioned there are several ways to set up nightwatch project. Here is what i have, seems to work well.
Create a new folder name "TestAutomation" and underneath the folder create the following folders and input all the drivers and jar files in correct folder.
/TestAutomation (Here is my nightwatch.json file which will help configurations) {
"src_folders" : ["tests"],
"output_folder" : "reports/XMLReports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "pages",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "lib/selenium/selenium-server-standalone-2.53.0.jar",
"start_session" : true,
"log_path" : "log/",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "lib/drivers/chromedriver"
}
},
"test_settings" : {
"chrome" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : "screenshots/Chrome/"
},
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args":["disable-web-security", "ignore-certificate-errors", "--test-type"]
}
}
},
"firefox" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : true,
"path" : "screenshots/Firefox/"
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
} |
@nelsonic you deserve some serious kudos just for going into that amount of detail to answer questions of a highly subjective nature that the OP could have also pretty easily answered himself. good job |
Is there a way to send all reports from different test folders to just one report folder? |
I have created selenium tests before, but just page objects, test specs and parameters, I've never setup a new project from scratch. I'm having troubles figuring out what my file structure should look like.
Ideally, I'd like to be able to write multiple test suites for different web apps. So my current file structure looks like this starting off
Sandbox >> Test Suite Web App A
Test Suite Web App B
From here, what should be within each Test Suite and at what file level?
For instance, should node_modules one folder level in from the Test Suite: Sandbox >> Test Suite Web App A >> node_modules?
Should my nightwatch folder be in my node_modules folder?
The nightwatch folder contains bin, examples, index.js, lib, license.md, package.json and READEME.md, are these all in the correct order or do any of these need to be within the A Test Suite folder?
Where should the selenium.jar file go?
Where should package.json go?
Where should nightwatch.conf.js go?
I want to use the example tests that come with the package to play around with first, should I treat these as their own test suite?
Does each test suite folder need to have the same setup?
I know there are a lot of questions here, I really appreciate all the help on this.
The text was updated successfully, but these errors were encountered: