Test Automation Prerequisites
This article outlines the prerequisites for test automation in the context of PriceFx Unity. It covers the basic knowledge required for using PriceFx Unity, as well as the tools needed for test automation, including an IDE tool, Git, Node.js, and a package manager.
PriceFx Unity is a platform that provides pricing management solutions. It is important for test automation because it allows automation of testing processes related to pricing management, which can help ensure the accuracy and efficiency of pricing strategies and calculations.
PriceFx Unity Knowledge
Having a basic understanding of the PriceFx application is beneficial for starting with test automation. Everyone should understand Unity’s common functionality of its shared features or functions available across different parts of the application. Additionally, knowledge of Unity’s application modules (ie. Price Setting, Quoting, etc.) and understanding each of their aspects is important for effectively automating tests related to the PriceFx solution.
As a foundation for starting with the test automation, it would be good to have some basic knowledge of PriceFx application.
LEARN MORE: To learn more about Unity’s common functionality, click here.
LEARN MORE: To learn about Unity’s application modules, click here.
Test Automation Tools
Before using test automation, there are some the tools required for using Cypress, a popular test automation framework. Here are the tools needed and their purposes:
An IDE tool: This is used for viewing and updating the code of the tests. The recommended IDE tool is Visual Studio Code, but other editors like IntelliJ Idea can also be used.
Git: This is for version control of the code. It can be used directly in Visual Studio Code, in the command line, or with a tool like Sourcetree. The text also mentions some basic Git commands needed for test automation, such as clone, fetch, pull, stage, commit, push, create, merge branch.
Node.js: This is required for using Cypress. While Cypress can be downloaded as an installation file without Node.js, having Node.js installed ensures clear functionality. The text also provides a command to check the installed version of Node.js.
Npm (Node Package Manager): it is installed directly with Node.js and is commonly used for managing packages and dependencies in Node.js projects.
These tools are essential for setting up the environment and managing the codebase when using Cypress for test automation.
You need to have the following tools installed in order to use Cypress:
Using An IDE tool
Pricefx recommends the use of the Visual Studio is an integrated development environment (IDE) created by Microsoft. It is used to develop computer programs, websites, web applications, and mobile apps. Visual Studio supports multiple programming languages, including C#, C++, Visual Basic, F#, and others.
Visual Studio offers an extensive array of features designed to assist developers in coding, debugging, and testing their software. These capabilities encompass code editing, debugging, profiling, automated and manual testing, and seamless integration with various version control systems.
Moreover, Visual Studio supports extensions that enhance the functionality of the integrated development environment (IDE). Additionally, it provides tools for building and deploying applications across different platforms, including Windows, iOS, Android, and the web. In summary, Visual Studio serves as a comprehensive development environment that caters to the requirements of both individual developers and large development teams.
LEARN MORE: To learn more about Visual Studio, click here.
- Visual Studio Code
Using Git
Git is a version control system that is widely used in software testing to manage test code, test data, and test configurations. Here's how Git is used for software testing:
Version Control: Git allows testers to version control their test code, test scripts, and test data. This ensures that changes to the test assets are tracked, and different versions of tests can be maintained.
Collaboration: Testers can collaborate with developers and other team members by using Git to share and review test code and changes. This helps in maintaining transparency and coordination within the testing team.
Branching and Merging: Git enables testers to create branches for new features or changes, allowing them to work on new tests without affecting the main test code. Testers can then merge their changes back into the main test codebase once the tests are ready.
Continuous Integration: Git integrates with continuous integration (CI) tools, allowing testers to trigger automated tests whenever new code is committed. This ensures that tests are run regularly and that any issues are identified early in the development process.
Test Automation: Test automation frameworks and test scripts can be stored in Git repositories, allowing testers to manage, update, and share automated tests effectively.
Issue Tracking: Git repositories can be linked with issue tracking systems, enabling testers to associate test code with specific issues or requirements. This helps in tracking the status of tests and their relevance to the overall development process.
Code Reviews: Testers can use Git to conduct code reviews for test scripts, ensuring that the quality of the test code meets the required standards.
By using Git for software testing, testers can ensure that their test assets are well-managed, changes are tracked, and collaboration with other team members is streamlined, ultimately contributing to the overall quality of the software being tested.
For version control of the code, Git can be utilized directly within Visual Studio Code, via the command line, or through a tool such as Sourcetree. Essential Git basics for developers include knowledge of commands such as clone, fetch, pull, stage, commit, push, as well as the ability to create and merge branches.
In the following screenshot, we highlight the Git version control system interface, specifically a GUI client that helps manage repositories. From this screenshot, we illustrate the following:
Showing various branches within a repository, including feature branches, bugfix branches, and the develop branch. The branches are labeled with a naming convention that includes an issue or case identifier, such as "CASECORE-2805" or "C4SECORE-2415."
Highlights where developers are working on different features and fixes, which are tracked by their respective branches.
Displays a section for "Uncommitted changes," "Pending files, sorted by file name," "Staged files," and "Unstaged files," suggesting that there are changes that have been made locally but have not yet been committed to the repository.
Shows that the uncommitted changes include merges from feature branches into the develop branch, which indicates that features or fixes have been completed and are being integrated into the main development line.
The unstaged files listed at the bottom are JSON files located in a directory named "cypress/fixtures," which implies that these could be test data files used for automated testing with the Cypress testing framework.
In summary, the screenshot provides insight into the workflow of a software development team using Git for version control and possibly automated testing as part of their development process. The GUI client helps visualize the progress and organization of work within the repository.
Using Node.js
Node.js is a popular open-source, cross-platform JavaScript runtime environment that allows developers to execute JavaScript code outside of a web browser. It is built on Chrome's V8 JavaScript engine and is designed to be lightweight and efficient for building scalable network applications. Here's a summary of Node.js:
JavaScript Runtime: Node.js provides an environment for running JavaScript on the server side, enabling developers to use JavaScript for both client-side and server-side development.
Event-Driven Architecture: Node.js uses an event-driven, non-blocking I/O model, making it well-suited for building data-intensive, real-time applications.
Package Management: Node.js comes with npm (Node Package Manager), which is a powerful package manager for installing, sharing, and managing dependencies for Node.js projects.
Scalability: Node.js is known for its ability to handle a large number of concurrent connections, making it suitable for building highly scalable applications.
Rich Ecosystem: Node.js has a rich ecosystem of libraries and frameworks, making it easy for developers to find tools and resources for building various types of applications.
Cross-Platform: Node.js is cross-platform, meaning it can run on various operating systems such as Windows, macOS, and Linux.
Community Support: Node.js has a large and active community, providing support, resources, and a wealth of third-party modules and libraries.
Asynchronous Programming: Node.js supports asynchronous programming, allowing developers to write non-blocking code that can handle multiple requests concurrently.
Overall, Node.js is a versatile and powerful platform for building server-side applications, APIs, and microservices, and it has gained widespread adoption in the web development community.
Using Node.js with Pricefx
Here are the primary aspects of Node.js within Pricefx projects:
When Cypress is downloaded as an installation file, it can function without Node.js. However, for optimal functionality, it is recommended to have Node.js installed.
You can check your actual version of node.js by command “node -v” in the command line:
Use of Package Manager
The Cypress package manager refers to the package management system used to install, manage, and update Cypress and its related dependencies. In the context of Cypress, the package manager typically refers to npm (Node Package Manager) or yarn, which are commonly used to handle the installation and management of Cypress packages and other JavaScript dependencies.
Using the package manager, developers can easily install Cypress, manage its versions, and handle its dependencies, making it convenient to integrate Cypress into their projects and keep it up to date with the latest features and bug fixes.
A package manager is used for installing and running plugins and dependencies for Cypress tests and Cypress itself. There are two popular package managers: NPM (Node Package Manager) and Yarn. NPM is installed directly with Node.js and is commonly used for managing packages and dependencies in Node.js projects. On the other hand, Yarn is an alternative package manager that can be used locally or on the server side.
In summary, a package manager is essential for managing the installation and execution of plugins and dependencies for Cypress tests, and developers can choose between NPM and Yarn based on their preferences and project requirements.
The installation of Yarn in your command line is: npm install --global yarn