Introduction: In the realm of modern APIs, the provision of clear and comprehensive documentation plays a pivotal role in facilitating developer adoption and ensuring efficient utilization. Swagger, aligned with the OpenAPI Initiative, stands out as a prominent solution, offering machine-readable documentation and a user-friendly interactive interface. In this guide, we'll delve into the seamless integration of Swagger into your .NET Core API. Step 1: Install the necessary packages Add Swashbuckle.AspNetCore NuGet package to a project: dotnet add package Swashbuckle.AspNetCore Add Swashbuckle.AspNetCore.SwaggerUI NuGet package to a project: dotnet add package Swashbuckle.AspNetCore.SwaggerUI Step 2: Add services in program.cs In the program.cs file, include the following service additions: builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); Additionally, add middleware in program.cs to enable Swagger in the development environment: if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } Step 3: Run the API project and access the Swagger UI at: https://your-api-base-url/swagger Ensure the API project is running, and navigate to the provided URL to explore and interact with the Swagger UI seamlessly. Step 3: Execute the APIs and test.
Hosting an Angular application on IIS involves a few straightforward steps. Follow this step-by-step guide to seamlessly deploy your Angular project on IIS. Step 1: Open Your Angular Project in Visual Studio Code Review the build command in the package.json file. By default, it's usually set to ng build. Step 2: Run the Build Command Execute the ng build command in the terminal to compile your Angular application. This command creates a 'dist' folder, typically located at the specified output path in the angular.json file. Step 3: Install IIS Ensure that IIS is installed on your machine. You can install it through the "Turn Windows features on or off" option in the Control Panel. Step 4: Create a New Site in IIS Open the IIS Manager. In the Connections pane, right-click on the "Sites" node and select "Add Website." Fill in the required information, such as the Site name, Physical path to the folder , and choose a port. Step 5: Configure URL Rewrite (Optional) If your Angular application uses routing, consider configuring URL Rewrite for proper routing. Create a 'web.config' file in your 'dist' folder with the appropriate configurations. Here's a simple example of a web.config file for an Angular application with routing.This file helps configure how the server handles URL requests. ---------------------------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Angular Routes" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite> <staticContent> <remove fileExtension=".json" /> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> </system.webServer> </configuration> ---------------------------------------------------------------------------------------------------------------- Step 6: Restart IIS After making these changes, restart IIS to apply the configurations. Step 7: Access Your Angular Application Open a web browser and navigate to http://localhost:yourport (replace 'yourport' with the specified port from Step 4). Now, your Angular application is hosted on IIS. Access it through the specified port. If any issues arise, check the IIS logs for more information. Customize these instructions based on your specific requirements and environment. Thanks!
In this blog, I will guide you on the power of CI/CD in GitHub with a step-by-step guide. Learn to set up automated workflows, boost project efficiency, and streamline development processes for better code quality and faster deployments. Certainly! It seems that I've encountered a challenge in my current development workflow when deploying minor code changes. The existing process involves manually publishing code from Visual Studio, creating backups of the current code on the server, and then replacing it with the new code. To address this, it's advisable to transition to an automated solution utilizing a Continuous Integration/Continuous Deployment (CI/CD) pipeline. By implementing a CI/CD pipeline, you can streamline and automate the deployment process, making it more efficient and reducing the risk of manual errors. The CI/CD pipeline will handle tasks such as code compilation, testing, and deployment automatically, ensuring that the latest changes are seamlessly deployed to the desired environment. This transition will not only save time but also enhance the reliability of your deployment process, allowing your team to focus more on development and less on manual deployment tasks. For additional information, refer to the steps outlined below for guidance. Step 1: Go to your repository and click on the Actions tab Step 2: Now, Select the workflow according to your development. Here I am using .NET workflow. Step 3: Now you can see the default pipeline as below. In that, you can change your branch as per your requirement. Step 4: You can now incorporate three new sections as outlined below to build the code and publish the folder as an artifact. - name: Build and publish run: | dotnet restore dotnet build dotnet publish -o publish - name: Zip output run: | cd publish zip -r ../output . - name: Upload zip archive uses: actions/upload-artifact@v2 with: name: test path: ./publish Upon integrating this code, your YAML file will now appear as follows. In the code above, you have the flexibility to rename the zip file or the publish folder according to your preferences. Build and Publish : This step is responsible for building and publishing the code. Commands: dotnet restore: Restores the project's dependencies. dotnet build: Compiles the project. dotnet publish -o publish: Publishes the project output to the 'publish' folder. Zip Output : This step involves compressing the contents of the 'publish' folder into a zip file. Commands: cd publish: Changes the working directory to the 'publish' folder. zip -r ../output .: Creates a zip file named 'output' containing the contents of the 'publish' folder. Upload Zip Archive :This step uploads the zip archive to the workflow run as an artifact. Using: The actions/upload-artifact@v2 GitHub Action. Configuration: name: test: Specifies the name of the artifact as 'test'. path: ./publish: Indicates the path of the folder to be archived and uploaded. By using the given code, you receive a finalized published folder prepared for deployment on the server. However, the deployment process on the server requires manual intervention. To access the published folder, navigate to the "Actions" tab. Click on the "test" workflow, and you can download the published folder from there. Step 5: In the steps mentioned above, you previously followed a manual process, but now you have transitioned to an automatic process. To automate the process, you'll need to install a self-hosted runner on the virtual machine where your application is hosted. What is Self-hosted runner? self-hosted runner is a system that you deploy and manage to execute jobs from GitHub Actions on GitHub.com. To install the self-hosted runner, follow the basic steps. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings. In the left sidebar, click Actions, then click Runners and then click on New self-hosted runner. Select the operating system image and architecture of your self-hosted runner machine. Open a shell on your self-hosted runner machine and run each shell command in the order shown. For more details you can visit https://docs.github.com/en/enterprise-cloud@latest/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners Step 6: To automate the process, you can remove the last two sections, "Zip Output" and "Upload Zip Archive," and replace them with the following code. - name: Backup & Deploy run: | $datestamp = Get-Date -Format "yyyyMMddHHmmss" cd publish Remove-Item web.config Remove-Item appsettings.json Remove-Item appsettings.Development.json Stop-WebSite 'DemoGitHubPipeline' Compress-Archive D:\Published\DemoGitHubPipeline D:\Published\Backup\Backup_$datestamp.zip Copy-Item * D:\Published\DemoGitHubPipeline -Recurse -Force Start-WebSite 'DemoGitHubPipeline' Backup & Deploy : This step is responsible for creating a backup, making necessary modifications, and deploying the application. Commands: $datestamp = Get-Date -Format "yyyyMMddHHmmss": Retrieves the current date and time in the specified format. cd publish: Changes the working directory to the 'publish' folder. Remove-Item web.config: Deletes the 'web.config' file. Remove-Item appsettings.json: Deletes the 'appsettings.json' file. Remove-Item appsettings.Development.json: Deletes the 'appsettings.Development.json' file. Stop-WebSite 'DemoGitHubPipeline': Stops the website with the specified name. Compress-Archive D:\Published\DemoGitHubPipeline D:\Published\Backup\Backup_$datestamp.zip: Creates a compressed archive (zip) of the existing deployment with proper timestamp. Copy-Item * D:\Published\DemoGitHubPipeline -Recurse -Force: Copies all contents from the 'publish' folder to the deployment directory. Start-WebSite 'DemoGitHubPipeline': Restarts the website with the specified name. Note: Ensure that the paths and folder structures match the actual locations in your setup. Adjust the website name and paths based on your specific configuration. Conclusion: In summary, implementing a CI/CD pipeline in GitHub is a pivotal step towards achieving efficiency, reliability, and accelerated development cycles. The integration of CI/CD streamlines the software delivery process by automating testing, building, and deployment, leading to consistent and high-quality releases. GitHub Actions, with its native CI/CD capabilities, provides a powerful and flexible platform for orchestrating workflows. Leveraging its features, development teams can not only automate repetitive tasks but also ensure rapid feedback on code changes, enabling early detection of issues and facilitating collaboration.
For their software systems, most of the companies are moving towards microservices models. This suggests that separate datastores and separate commands for dealing with that datastore will be available in various parts of their programme. Microservices attract software providers because they allow software modules to be implemented more quickly; when one part of an application is modified, it is possible to continue to work in the other areas of the application. Most of the microservices use Application Programming Interfaces (APIs); API is a series of commands about how a function can be used. And most APIs use Hypertext Transmission Protocol (HTTP) requests for Representational State Transfer (REST) to request and submit data. So, let’s dive deeper and see what is API and API Testing and understand the different criteria of API Testing: What is the Application Programming Interface (API)? Application Programming Interface (API) is a computer interface that allows 2 different software systems to communicate and share data. The software framework running an API requires many functions/subroutines that can be handled by another software system. The API specifies requests that can be made between two software systems, how to send requests, data formats that can be used, etc. What is API Testing? API TESTING is a method of software testing that validates APIs. The aim of API Testing is to verify the programming interfaces' accessibility, compatibility, performance, and security. In API Research, you use tools to send calls to the API, get output, and write down the system's response instead of using normal user inputs(keyboard) and outputs. API Tests are somewhat different from GUI Tests and won't rely on an application's look and feel. Cases when API Testing should be checked: Return value dependent on input condition - Because input can be specified and results can be authenticated, it is reasonably easy to verify. Do not return anything - If there is no return value, verify the action of the API on the device. Cause any other API/event/interrupt - If any event or interrupt is triggered by an API entry, these events and interrupt listeners should be tracked. Data structure update - The device will have an output or effect on the data structure update, and it should be authenticated. Modify certain resources - If the API call modifies certain resources, it should be checked by accessing the respective resources. API Testing Methodology: QA Team performs the predefined approach i.e. API Testing Methodology in order to conduct the API testing after the build is ready. API Testing does not involve source code. The method of API testing helps to better understand the functionalities, testing methods, feedback criteria and test case implementation. Following are the points that encourages the user to take API Testing Methodology: Understanding the API program's capabilities and specifically describing the program's reach . Apply testing methods such as classes of equivalence, study of boundary value, and API error guessing and writing test cases. Input API parameters need to be adequately designed and specified. Run the test cases and compare the outcomes predicted and actual. API Testing Steps: Testing for API Automation should cover at least the following test methods, rather than the normal SDLC procedure: Discovery Testing: The test group can carry out the collection of calls documented in the API manually, such as checking that it is possible to list, build and uninstall a particular resource exposed by the API as necessary. Usability Checking: This testing verifies whether the API is user-friendly and usable. And the API also interacts well with other platforms. Security Monitoring: This testing concerns the form of protection needed and if confidential data is encrypted over HTTP or both. Automated Testing: API testing can result in a series of scripts or a method that can be used daily to run the API. Documentation: To communicate with the API, the research team needs to make sure that the documentation is sufficient and contains enough detail. Documentation should be used in the final deliverables Following is the best practices for API Testing: The API test cases can be classified by the types of tests. You should have the declarations of the APIs being named on top of each test. In the test case itself, parameter selection should be specifically stated. Prioritize calls to the API feature so that testers can test quickly. Each test case should be as autonomous and isolated as possible from dependencies. Following are the types of bugs that API Testing can detect: Fails to manage error situations. Duplicate or incomplete features. Durability issues. Difficulty in linking and receiving an API reply. Safety issues. Issues of multi-threading. Efficiency issues. Very high API response time. Inappropriate mistakes/warning to a caller. Following are the main challenges of API Testing: Parameter Combination, Parameter Collection, and Call Sequencing are the key problems in Web API testing. No Interface is available for checking the programme, making it impossible to have input values. It is necessary for testers to know the Collection and categorization of parameters. It is important to verify the exception handling feature. For testers, coding expertise is important. Benefits of API Testing: Access to an application without User Interface. Protection from malicious code and breakage. Cost-Effective. Reduces Testing Cost. Technology Independent. Conclusion - API Testing is a fundamental part of API development and is considered to be a challenging part of software testing. The API consists of a collection of classes/functions/procedures describing a layer of business logic. If the API is not properly checked, not only the API application, but also the calling application can cause problems. PS - By joining hands with MagnusMinds for API Testing services, you’re ensuring that you’ll get the best of the API Testing Services. Our simple and foundational approach to API Testing is to develop a dynamic and robust research strategy. At the initial level, we group all test cases depending on the type of the test. After that for the most predicted and highly normal effects, we first perform research. We delegate API method calls to goals, making the whole testing process smoother and faster. We guarantee checking for failure to provide you a smooth software that gives reliable performance.
We all have been in a position where a certain bug destroys the user experience in our app. So why does such a situation occur? The reason is very simple: It’s the insufficiency in Web Application Testing. The Testing stage is an extremely critical aspect in the development of software, still, some developers underestimate it. The dilemma is with every code, the risk of an error occurring increases, and the expense of bug fixing increases with time. Thus, Web Application Testing is required to assure that an application is completely usable and runs efficiently and safely. So, let’s dive deeper and see what is Web Application Testing and understand the different criteria of Web Application Testing: What is Web Application Testing? Web Application Testing tests for possible vulnerabilities on the web server or website before it is made live and available to the general public. During this phase, problems such as web application protection, the functioning of the platform, its connection to disabled as well as frequent users, and its ability to manage traffic are tested. Why should you test your Website? It's really important to test your website and below are a few reasons to persuade you of that: Websites will face many problems, such as broken connections, non-operational search features, images that are not loaded, forms that are not submitted correctly, etc. So, it gets important to conduct Website Testing on it to ensure that the website does not face any such issues. As many different browsers are available in the market, it becomes very important to check that the website runs well on all the widely used browsers. Today, most individuals use their smartphones as their primary device. Mobile traffic increases year over year and is poised to surpass desktop traffic very soon. According to Statista, there are 6.95 billion mobile subscribers in 2020 and the number is expected to reach 7.41 billion by 2024. With such a huge population accessing mobile devices, it becomes very important to make sure that different mobile devices are well-tuned to your website. Another major factor of website testing that makes the website score better on different search engines is SEO Testing. Checking your website for the right implementation of Google Analytics will help you better calculate the numbers of your visitors. It also helps to evaluate and monitor your website's performance. Another quite essential aspect of website testing is the Quality Testing of the website. By doing proper Website Security Testing, an important concern i.e. Website Protection can be solved effectively. Different types of Web Application Testing: Functionality Testing - Functionality Testing is a method containing multiple evaluation criteria such as user interface, APIs, database testing, security testing, client and server testing, and simple functionalities of the website. Functionality Testing is very simple and requires both manual and automatic testing to be performed by consumers. In Functionality Testing, the accessibility of each element on the website is checked. Usability Testing - Usability Testing is a method for evaluating how basic a software application is and how user-friendly it is. Usability Testing focuses specifically on the ease of use of the application by the customer, application reliability to manage controls, and application capability to achieve the targets. Interface Testing - Interface Testing is a method of software testing that verifies whether the communication between two separate software systems is performed correctly or not. The interface is the name of a connector that combines 2 components. In a computer environment, this interface could be anything like APIs, web servers, etc. Testing of these linking services or interfaces is known as Interface Testing. Database Testing - Database Testing is a method of testing software that tests the schema, tables, triggers, etc. of the test database. It tests the accuracy and quality of the data as well. Database Testing involves generating complicated queries to monitor the database for load/stress and validate its responsiveness. Database Testing helps to save data loss, protects aborted transaction data, and does not allow any unauthorized person to access the data. Compatibility Testing - To ensure customer loyalty, Compatibility is non-functional testing. Compatibility Testing is a method to decide whether your web application or product is capable of running on multiple browsers, libraries, hardware, operating systems, handheld devices, and networks or not. Performance Testing - Performance Testing is a method of software testing used to assess the speed, reaction time, consistency, durability, scalability, and resource utilization of a given workload software program. The key goal of Performance Testing is to define the performance bottlenecks in the software program and to remove them. Security Testing - Security Testing is a method to identify the system's risks and calculate their probable drawbacks so that the threats can be encountered and the device does not stop operating or cannot be manipulated. It also helps to recognize all the potential security problems in the system and by coding, it helps the developers to address the issues. Crowd Testing - Crowd Testing means that in real-world situations, we assess and refine the user-friendliness, accessibility, and usefulness of your digital goods leveraging the mutual awareness of a global online network i.e. our audience. Crowd Testing can be used to test any type of software, but when used for testing user-centric apps targeted at a broad user base, it reveals its actual strength. Therefore, online and smartphone apps, portals, and user software are usually considered. Therefore, online and smartphone apps, websites, and user software are usually taken into account. Benefits: Verifying whether users can effectively complete their tasks on-site without any complications. It helps to discover accessibility challenges so that redesign expenses can be avoided. Enable you to lower your costs of service and concentrate on your business. Enable you to decide why your website was not able to retain the potential visitors. Ensuring that the application is compliant with a wide variety of devices and platforms. Ensure that all potential test cases aimed at the web app work correctly. Can identify broken links on your website. Conclusion - While joining the online market with your own website or web application, make sure that you have a top priority for Web Application Testing in your company’s checklist. If your site is lacking somewhere until it is running live, then you will regret for not checking it previously. PS - By joining hands with MagnusMinds for Web Application Testing services, you’re ensuring that your customers and clients are going to get the best potential software. We will test your web page to optimize load time, insertion test, and test for maximum traffic loads. We use both manual and automated testing methods for in-depth evaluation of your website before launch. You’ll receive all documentation of test cases and updates as we work through our majestic list of web app tests. From load times to ultimate stress tests, you’ll see just how your web app functions and will be given custom recommendations for improvement.
There are so many mobile applications launch in the market every day but there are few successors, Mobile app testing is a process that finds bugs, issue and glitches into mobile application. In such high competency ratio, you have to be sure that apart from offering something innovative and interesting to your customers your application should also be free from any glitches. And hence, mobile app testing is becoming very important. Your application must also be free from flaws. And therefore mobile app testing is becoming very important. What is Mobile Application Testing..? Mobile Application testing is a process by which application software developed for portable mobile devices is tested for functionality, usability, and consistency. Mobile Application Testing can be either automated or manual. Why Mobile Application Testing is necessary? Turning on/off GPS Different devices Use different OS Use different Screen resolution Testing in different Screen orientation (landscape, portrait), Others… Types of Mobile Application Mobile web Application Hybrid Application Native Application Mobile Web Applications: Mobile web applications refer to applications for mobile devices that only require the installation of a web browser on the device. Simple mobile web applications limit the use of RIA technologies and are designed to present information in a readable and action-oriented format. Native Application: A Native Application is a software program that is developed for use on a particular platform or device like Windows 10, Android app, IOS app, Blackberry. Hybrid Application: A (hybrid application) is a software application that combines elements of native applications and web applications. Hybrid applications are essential web applications that have been placed in a native application shell. 5 Major Types of Mobile application Testing: Usability Testing: It checks how friendly the app is in terms of use and intuitiveness. Mobile apps need to be tested early and very often. User experience requirements include clarity of navigation, intuitive interface, the appearance of application design, error messages, and handling. Function Testing: This type of test results if the application is working correctly or not. It focuses on the main purpose and flow of the application, ensuring that all of its functions are responsive and within specification. Performance Testing: Performance testing is a key element in the mobile app testing process. You will be able to track and predict performance changes for spikes in connection quality (3G, 4G, LTE), change in a user's location, increased traffic, etc… When it comes to mobile applications, you should also test the product on different devices to see if performance is affected by the change in screen dimensions. Installation Testing: The Application Installation Test tests the successful installation of your mobile application on various mobile devices, models, and operating systems. Mobile Device Testing: Mobile Device Testing function ensures the quality of mobile devices, such as mobile phones, PDAs, etc. The tests will be carried out on both hardware and software. Conclusion: Mobile Application Testing has become a critical part of mobile app development. Most of the problems faced by an app could be solved by a successful mobile app test. This also increases time to market and ensures the success of the application. There are so many mobile applications launch in the market every day but there are few successors. Mobile Application Testing is a process that finds bugs, issue, and glitches into mobile application. RELATED BLOGS: Why Software Testing is Important in software development life cycle?
Testing is important as it discovers defects/errors before delivery to the customer, ensuring the quality of the software. It makes the software more reliable and easier to use. Thoroughly tested software ensures reliable, high-performance software operation. For example, assume you are using an Online Shopping application to Place any order and Pay the amount of order using any online platform. So, you initiate the transaction, get a successful transaction message, and the amount also deducts from your account. However, your Order is not placed yet. Likewise, your account is also not reflecting the reversed transaction. This will surely make you upset and leave you as an unsatisfied customer. Software testing contributes to the overall success of the project While requirement review and creating project timeline testers involvement - while review project requirement tester help to identification of some of the requirement defects even before their implementation. this help in Project cost and timeline. While the Design phase tester works with the system designers - it will increase the quality of design. it will help in reducing design flaws and make it user friendly. While Project Developments tester works with developers - Testers are aware of areas that are considered risky by the developer so they can adjust their preferences accordingly. In addition, the developers also get the tester's insights. Helps to recreate errors there and then, without going through a lengthy defect management process. Before the Software release testers verifying and validating the software - This helps detect errors that might otherwise go unnoticed, and supports the process of removing the defects that caused the failures. Running tests at multiple levels increase the likelihood that the software will have fewer bugs and also meet customer needs. Reasons Why Software Testing is Important 1. Identification of Bugs and Defects Testing phase is one phase that determines the bugs and errors in the application. These bugs can be at the unit level or system level. With so many testing phases, you get to keep away from any kind of bugs that may be affecting your application. 2. Improvement in Product Quality As testing is a phase that helps in knowing the actual outcome and the expected outcome. Surely, it can help you to improve your product quality. With proper testing done, you come out of errors and develop perfect software applications for the users. 3. Technical Importance In any SDLC lifecycle, the testing phase is important for the technical aspect, as it has to come out with the best technically sound application. 4. Improved Quality Properly tested software gives you more confidence in coming up with great software. Secondly, it improves the quality of your software application as continuous and all kinds of testing modes have made a secure and safe application that can be used by the end-users. 5. Verification and validation One of the main aims of the testing phase in SDLC is for verification and validation. Testing is a phase that can serve as metrics as it is used heavily in the V&V method. Based on the result, you could come out with a comparison between qualities amongst different products. 6. Reliability Estimation This is yet another important factor that is determined by the testing phase. If your software application has gone through all small levels like unit testing and major testing like regression testing and all, then surely it is a reliable application. Hence testing determines the reliability of your software application. Testing may serve as the best statistical method that defines operational testing on application resulting in a reliable software product. 7. Prove Usability and Operability One very important aim of software testing is to prove the software is both usable and operable. Usability testing is where the software is released to a select group of users and their working with the product is observed. All aspects of a user's interaction with the software, like the ease of use and where users are facing problems, are recorded and analyzed Conclusion: To conclude, the importance of software testing is imperative. Software testing is a crucial component of software product development because it improves consistency and performance. The main benefit of testing is the identification and subsequent removal of the errors. However, testing also helps developers and testers to compare actual and expected results in order to improve quality. If the software production happens without testing it, it could be useless or sometimes dangerous for customers. So, a tester should wear a unique hat that protects the reliability of the software and makes it safe to use in real-life scenarios. RELATED BLOGS: What is Mobile App Testing?