An open API service indexing awesome lists of open source software.

https://github.com/jrh89/selenium-testing

This project provides a suite of Selenium tests for automated browser testing. It includes various tests such as form submission, navigation, and smoke tests. The project is designed to be easily configurable and extendable to meet different testing needs.
https://github.com/jrh89/selenium-testing

regression-testing selenium smoke-tests testing testing-tools

Last synced: 4 months ago
JSON representation

This project provides a suite of Selenium tests for automated browser testing. It includes various tests such as form submission, navigation, and smoke tests. The project is designed to be easily configurable and extendable to meet different testing needs.

Awesome Lists containing this project

README

        

# Selenium Testing

This project provides a suite of Selenium tests for automated browser testing. It includes various tests such as form submission, navigation, and smoke tests. The project is designed to be easily configurable and extendable to meet different testing needs.

## Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)
3. [Configuration](#configuration)

## Installation

Follow these steps to install and set up the project:

1. **Clone the repository**: First, you need to clone the repository to your local machine.

```bash
git clone https://github.com/jrh89/selenium-testing.git
```

2. **Navigate to the project directory**: Change your current directory to the project directory.

```bash
cd selenium-testing
```

3. **Install dependencies**: Install all the necessary dependencies using npm.

```bash
npm install
```

## Usage

To run the tests, use the following command:

```bash
npm test
```

## Configuration

The project includes a config.js file where you can set various configuration options to customize the tests according to your needs. This file includes URLs, credentials, and other parameters used in the tests.

### Editing the Configuration

To customize the tests, follow these steps:

1. **Open the config.js file**: Locate and open the config.js file in the project directory. This file contains configuration settings for various tests.

2. **Modify the configuration settings**: Update the values in the `config.js` file to suit your testing requirements. Below is an example config.js file with explanations of each field:

```javascript
export const config = {
url: 'http://www.hookerhillstudios.com/Login',
validCredentials: {
email: '[email protected]',
password: 'Testing123!',
},
loginButtonText: 'Login',
expectedUrl: 'https://www.hookerhillstudios.com/',
google: {
url: 'http://www.google.com',
searchQuery: 'Selenium WebDriver',
expectedTitle: 'Selenium WebDriver',
homeTitle: 'Google'
},
formSubmissionTest: {
url: 'http://www.hookerhillstudios.com/Login',
credentials: {
email: '[email protected]',
password: 'Testing123!'
},
loginButtonText: 'Login',
expectedUrl: 'https://www.hookerhillstudios.com/'
},
hackerNewsTest: {
url: 'https://news.ycombinator.com/newest', // Use the 'newest' section URL for the test
expectedNumberOfArticles: 100,
timestampSelector: '.age', // Selector for timestamps
articleSelector: '.athing', // Selector for article containers
articleTitleSelector: '.storylink', // Selector for article titles
}
```

3. **Edit the URLs, credentials, and other parameters**: Modify the values in the `config.js` file to suit your testing needs.

4. **Save the config.js file**: After making the necessary changes, save the file.

5. **Run the tests**:

```bash
npm test
```

By following these steps, you can customize the Selenium tests to work with different websites, credentials, and other parameters, making the testing framework versatile and adaptable to various use cases.