This document discusses using AWS Device Farm to test mobile apps in the cloud. Some key points:
- AWS Device Farm allows testing mobile apps on a large fleet of real iOS, Android and Fire OS devices without needing physical devices. Tests can run in parallel and results are available quickly.
- It provides access to non-rooted/non-jailbroken devices with the same profiles as customers. Tests can simulate different scenarios by configuring language, location, device states etc.
- Popular automation frameworks like Appium, Calabash etc. can be used to run automated tests. Tests can also be integrated into continuous integration workflows.
- In addition to automated testing, remote access allows interacting with
This document provides an overview and examples of using the Pytest testing framework. Some key points:
- Pytest allows writing tests in plain Python functions, with test discovery and running. It supports fixtures for dependency injection and parametrizing tests.
- Basic usage involves writing test functions prefixed with "test_" and running pytest to discover and execute them. Fixtures provide a way to inject dependencies into tests.
- Fixtures can be defined and applied at various scopes (function, class, module). They support dependency injection, parameterization, setup/teardown functionality.
- Pytest offers many options for running tests selectively, debugging failures, tracing execution, and extending functionality through plugins. It aims to make
The document provides an introduction and overview of using Google Mock (gmock) for testing in C++. It discusses key concepts like the system under test (SUT), test doubles, mocks, stubs, and fragile tests. It then provides a tutorial example of defining a mock class for a Turtle interface to allow testing code that depends on drawing functions without executing the real drawing implementation.
This document discusses the webdriver.io framework for automated browser testing. The author needed a framework for blackbox testing of a web interface like a user would. Webdriver.io provides JavaScript bindings for Selenium that allow writing tests in a synchronous style using the browser object. Tests can run across multiple browsers and platforms. The framework is easy to set up and use, supports plugins, and allows custom commands. Under the hood, it communicates with Selenium using the WebDriver protocol to automate actual browsers.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
Slides of the Talk I gave at Devoxx Belgium 2019.
=== Abstract ===
Focusing on the creative work without being terrified of breaking the existing behavior can make software development very addictive! Good automated tests can buy you that!
However, if your tests are not maintainable they may end up slowing you down and causing you painful headaches, compilation errors and spurious failures. To avoid that, your unit tests should be significant; expressive; clean; DRY; non-overlapping; and blazing fast. Writing good tests becomes the toughest challenge for any developer, no matter how battle-hardened: you need to balance risk with test maintenance costs, while looking out for test design smells that call for [risky] refactoring to drive your design towards a set of key principles (included:).
Principles that will end up shaping the way you craft the Production code itself. Because in the end, a good, clean design is more important than coverage%.
But testing gives you the best feedback to get there.
Grab a black coffee and join this snippet from Victor’s Pro Unit Testing #training, to learn about testing priorities, buggy tests, the shared @Before, Mocks vs Stubs and how to reduce them by "purifying" your logic, testing Legacy Code and refactoring @Spy-es out.
All of that in an entertaining, dynamic and memorable session.
QA Challenge Accepted 4.0 - Cypress vs. SeleniumLyudmil Latinov
This document compares the Cypress and Selenium testing frameworks. It provides an overview of each framework, including supported languages, browsers, and key differences. The document suggests Cypress may signal the end of an era for Selenium as it provides direct browser control, easier debugging of tests, and support for testing desktop applications like Electron. It highlights some unique features of Cypress, such as controlling application state and network traffic. The presentation ends with a Q&A section.
Don't Be Mocked by your Mocks - Best Practices using MocksVictor Rentea
Do you ❤️ Mocks? When you write your first unit tests, especially on older codebases, mocking foreign code is key to survival. But as you grow older in the craft, you start piling up hours and days wasted to refactor fragile tests or to fix bugs that those heavy mock-based tests didn't catch. And so you start looking at Mocks differently.
Let's go through the key factors to consider to strike the optimal balance between what needs to be mocked away and what code should be tested in integration. There's sometimes a fine line there, often interwoven with strong emotions:
"Why am I testing this?"
"Argh… these tests take too long"
"Can this ever really break?"
etc...
Among the points that we'll touch on:
- Mocks vs Refactoring
- Mocks vs Reliability
- Fine vs Coarse Mocks
- Reproducibility
- Partial Mocks
- Mocking Statics
- Alternatives to Mocks
Speakers: Victor Rentea
Victor is a Java Champion and Independent Trainer with an impressive experience: thousands of developers in dozens of companies trained in dedicated company sessions. He is the founder of one of the largest developer communities in Romania, Bucharest Software Craftsmanship Community and a top international conference speaker.
To find more about him, join a live masterclass or call him in for a company dedicated training: victorrentea.ro
This document discusses using AWS Device Farm to test mobile apps in the cloud. Some key points:
- AWS Device Farm allows testing mobile apps on a large fleet of real iOS, Android and Fire OS devices without needing physical devices. Tests can run in parallel and results are available quickly.
- It provides access to non-rooted/non-jailbroken devices with the same profiles as customers. Tests can simulate different scenarios by configuring language, location, device states etc.
- Popular automation frameworks like Appium, Calabash etc. can be used to run automated tests. Tests can also be integrated into continuous integration workflows.
- In addition to automated testing, remote access allows interacting with
This document provides an overview and examples of using the Pytest testing framework. Some key points:
- Pytest allows writing tests in plain Python functions, with test discovery and running. It supports fixtures for dependency injection and parametrizing tests.
- Basic usage involves writing test functions prefixed with "test_" and running pytest to discover and execute them. Fixtures provide a way to inject dependencies into tests.
- Fixtures can be defined and applied at various scopes (function, class, module). They support dependency injection, parameterization, setup/teardown functionality.
- Pytest offers many options for running tests selectively, debugging failures, tracing execution, and extending functionality through plugins. It aims to make
The document provides an introduction and overview of using Google Mock (gmock) for testing in C++. It discusses key concepts like the system under test (SUT), test doubles, mocks, stubs, and fragile tests. It then provides a tutorial example of defining a mock class for a Turtle interface to allow testing code that depends on drawing functions without executing the real drawing implementation.
This document discusses the webdriver.io framework for automated browser testing. The author needed a framework for blackbox testing of a web interface like a user would. Webdriver.io provides JavaScript bindings for Selenium that allow writing tests in a synchronous style using the browser object. Tests can run across multiple browsers and platforms. The framework is easy to set up and use, supports plugins, and allows custom commands. Under the hood, it communicates with Selenium using the WebDriver protocol to automate actual browsers.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
Slides of the Talk I gave at Devoxx Belgium 2019.
=== Abstract ===
Focusing on the creative work without being terrified of breaking the existing behavior can make software development very addictive! Good automated tests can buy you that!
However, if your tests are not maintainable they may end up slowing you down and causing you painful headaches, compilation errors and spurious failures. To avoid that, your unit tests should be significant; expressive; clean; DRY; non-overlapping; and blazing fast. Writing good tests becomes the toughest challenge for any developer, no matter how battle-hardened: you need to balance risk with test maintenance costs, while looking out for test design smells that call for [risky] refactoring to drive your design towards a set of key principles (included:).
Principles that will end up shaping the way you craft the Production code itself. Because in the end, a good, clean design is more important than coverage%.
But testing gives you the best feedback to get there.
Grab a black coffee and join this snippet from Victor’s Pro Unit Testing #training, to learn about testing priorities, buggy tests, the shared @Before, Mocks vs Stubs and how to reduce them by "purifying" your logic, testing Legacy Code and refactoring @Spy-es out.
All of that in an entertaining, dynamic and memorable session.
QA Challenge Accepted 4.0 - Cypress vs. SeleniumLyudmil Latinov
This document compares the Cypress and Selenium testing frameworks. It provides an overview of each framework, including supported languages, browsers, and key differences. The document suggests Cypress may signal the end of an era for Selenium as it provides direct browser control, easier debugging of tests, and support for testing desktop applications like Electron. It highlights some unique features of Cypress, such as controlling application state and network traffic. The presentation ends with a Q&A section.
Don't Be Mocked by your Mocks - Best Practices using MocksVictor Rentea
Do you ❤️ Mocks? When you write your first unit tests, especially on older codebases, mocking foreign code is key to survival. But as you grow older in the craft, you start piling up hours and days wasted to refactor fragile tests or to fix bugs that those heavy mock-based tests didn't catch. And so you start looking at Mocks differently.
Let's go through the key factors to consider to strike the optimal balance between what needs to be mocked away and what code should be tested in integration. There's sometimes a fine line there, often interwoven with strong emotions:
"Why am I testing this?"
"Argh… these tests take too long"
"Can this ever really break?"
etc...
Among the points that we'll touch on:
- Mocks vs Refactoring
- Mocks vs Reliability
- Fine vs Coarse Mocks
- Reproducibility
- Partial Mocks
- Mocking Statics
- Alternatives to Mocks
Speakers: Victor Rentea
Victor is a Java Champion and Independent Trainer with an impressive experience: thousands of developers in dozens of companies trained in dedicated company sessions. He is the founder of one of the largest developer communities in Romania, Bucharest Software Craftsmanship Community and a top international conference speaker.
To find more about him, join a live masterclass or call him in for a company dedicated training: victorrentea.ro
This document provides an introduction to Behavior Driven Development (BDD) with Cucumber. It discusses that BDD uses examples expressed in a way that can be automated to reduce misunderstandings. Stories are written in business language and describe requirements and acceptance criteria. Scenarios specify conditions a story must meet to be complete. Cucumber is a tool that executes plain text functional descriptions as automated tests. It supports collaboration between stakeholders and allows writing scenarios before code.
This document discusses automated testing for web applications. It defines automated testing as writing a program to perform tests that would otherwise need to be done manually. The document outlines advantages of automated testing like ability to rerun tests quickly and ability to perform cross-browser compatibility testing. It also discusses disadvantages like initial costs. The document provides examples of automated testing frameworks and demonstrates Watir and Selenium frameworks. It ends with asking for any questions.
QAOps - O QA com pézinho em DevOps (Ministry of Testing Floripa 2019)Mayara Fernandes
O documento descreve como um time de desenvolvimento e teste pode melhorar seus processos adotando práticas DevOps, como integração contínua, entrega contínua e deploy automático. Ele exemplifica as etapas para automatizar o build, adicionar testes unitários e de API/integração, implantar em um ambiente de staging e automatizar testes de aceitação, reduzindo o tempo de feedback de dias para minutos.
The document discusses testing tools Cypress and Selenium. It provides an overview of the speaker's background and experience in testing and automation. It then compares Cypress and Selenium on aspects like speed, waits, setup, and drawbacks. Cypress is praised for its out of box features like waits and ability to write asynchronous code synchronously. However, it is noted that modules can be overridden in Cypress and it currently does not support cross-browser or window switching capabilities.
Test Automation Framework Development IntroductionGanuka Yashantha
The document discusses test automation frameworks and the page object model pattern. It recommends treating automated testing as software development with principles like separation of concerns. The page object model pattern models pages as objects and allows tests to interact with pages through page object classes. Data driven testing is also discussed where test data is stored externally in spreadsheets or databases and passed into tests.
Beginners - Get Started With Unit Testing in .NETBaskar K
Beginners - Get started with unit testing in .NET. Introduction to unit testing and mocking.. List of unit testing frameworks available in .NET - NUnit, xUnit.net, Visual Studio unit test framework. List of mocking frameworks available in .NET - Moq, Rhino Mocks, FakeItEasy, NSubstitue, JustMock, and TypeMock. Introduction to Visual Studio Unit Testing Framework, NUnit and xUnit.net.
This document provides an overview of Jest, a JavaScript testing framework built by Facebook. It discusses Jest's features like testing, mocking, snapshots, and best practices. Key features include built-in support for mocking, coverage, isolation, and watch mode. It also covers how to write tests with Jest including describing tests, modifiers, setup/teardown, and mocking modules, objects, functions, and timers.
The document discusses Google Test, an open source unit testing framework for C++ that can also be used for testing C code, providing an overview of its features and how to implement unit tests using common patterns like test fixtures, assertions, and death tests to validate expected failures. It also covers best practices for writing effective unit tests, including keeping tests independent, focused, and fast-running.
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Victor Rentea
Are you in a mood for a brainstorm? Join this critical review of the major decisions taken in a typical enterprise application architecture and learn to balance pragmatism with your design goals. Find out how to do just-in-time design to keep as much use-cases as simple as possible. The core purpose of this presentation is to learn to strike a **balance between pragmatism and maintainability** in your design. Without continuous refactoring, a simple design will inevitably degenerate into a Big Ball of Mud, under the assault of the new features and bugfixes. On the other hand, very highly-factored code can burden the take-off of the development and end up freezing the mindset in some rigid 'a-priori' design. The end goal of this talk is to challenge you to rethink critically the architecture of your own systems, and seek ways to simplify it to match your actual needs, with a pragmatic mindset. "Architecture is the art of postponing decisions", said Uncle Bob. This talk takes this idea further and explains an optimal mindset about designing enterprise applications: Evolving (Continuously Refactoring) a Pragmatic (Simple), Clean (aka Onion) Architecture, aiming to provide Developer Safety™️ and Comfort™️. It’s the philosophy that Victor distilled over the past 5 years, designing and implementing 9 applications as IBM Lead Architect, and delivering trainings and advises to many other companies. You’ll learn how to break data into pieces (Fit Entities, Value Objects, Data Transfer Objects), how to keep the logic simple (Facades, Domain Services, logic extraction patterns, Mappers, AOP), layering to enforce boundaries (keeping DTOs out of your logic, Dependency Inversion Principle), and many more, all in a dynamic, interactive and extremely entertaining session.
Unit testing involves writing code to test individual units or components of an application to ensure they operate as intended. A unit test targets a specific function or class and ensures the code works correctly. A test suite is a collection of test cases that test a module. Frameworks like JUnit simplify the unit testing process and allow for test automation. JUnit tests are created in the same project structure with a "Test" suffix and use annotations to define test cases and suites. Tests can then be run and results analyzed to measure code coverage.
The document discusses various unit testing frameworks for .NET such as MSTest v2, NUnit, and xUnit.net. It provides information on the key features of each framework, how to install and set them up, how to write tests, and comparisons between the frameworks. The document recommends NUnit as it has the richest set of assertions, supports data-driven testing well, and has full documentation available, which would be important for a new development team to learn to use the framework effectively.
This document summarizes a presentation about using CucumberJS, WebDriverIO, and Docker for behavior-driven development (BDD) and continuous integration (CI). It discusses using CucumberJS with Gherkin syntax to write automated test cases in a business-readable format. WebDriverIO is introduced as a framework for automating tests in Node.js. The presentation demonstrates setting up a WebDriverIO project, running tests in Docker containers, and integrating everything with Travis CI for continuous testing. Code examples are provided for configuring WebDriverIO to use Docker services and setting up Docker containers in a Travis CI configuration file.
Unit Testing Concepts and Best PracticesDerek Smith
Unit testing involves writing code to test individual units or components of an application to ensure they perform as expected. The document discusses best practices for unit testing including writing atomic, consistent, self-descriptive tests with clear assertions. Tests should be separated by business module and type and not include conditional logic, loops, or exception handling. Production code should be isolated from test code. The goal of unit testing is to validate that code meets specifications and prevents regressions over time.
This document provides an introduction to Behavior Driven Development (BDD) with Cucumber. It discusses that BDD uses examples expressed in a way that can be automated to reduce misunderstandings. Stories are written in business language and describe requirements and acceptance criteria. Scenarios specify conditions a story must meet to be complete. Cucumber is a tool that executes plain text functional descriptions as automated tests. It supports collaboration between stakeholders and allows writing scenarios before code.
This document discusses automated testing for web applications. It defines automated testing as writing a program to perform tests that would otherwise need to be done manually. The document outlines advantages of automated testing like ability to rerun tests quickly and ability to perform cross-browser compatibility testing. It also discusses disadvantages like initial costs. The document provides examples of automated testing frameworks and demonstrates Watir and Selenium frameworks. It ends with asking for any questions.
QAOps - O QA com pézinho em DevOps (Ministry of Testing Floripa 2019)Mayara Fernandes
O documento descreve como um time de desenvolvimento e teste pode melhorar seus processos adotando práticas DevOps, como integração contínua, entrega contínua e deploy automático. Ele exemplifica as etapas para automatizar o build, adicionar testes unitários e de API/integração, implantar em um ambiente de staging e automatizar testes de aceitação, reduzindo o tempo de feedback de dias para minutos.
The document discusses testing tools Cypress and Selenium. It provides an overview of the speaker's background and experience in testing and automation. It then compares Cypress and Selenium on aspects like speed, waits, setup, and drawbacks. Cypress is praised for its out of box features like waits and ability to write asynchronous code synchronously. However, it is noted that modules can be overridden in Cypress and it currently does not support cross-browser or window switching capabilities.
Test Automation Framework Development IntroductionGanuka Yashantha
The document discusses test automation frameworks and the page object model pattern. It recommends treating automated testing as software development with principles like separation of concerns. The page object model pattern models pages as objects and allows tests to interact with pages through page object classes. Data driven testing is also discussed where test data is stored externally in spreadsheets or databases and passed into tests.
Beginners - Get Started With Unit Testing in .NETBaskar K
Beginners - Get started with unit testing in .NET. Introduction to unit testing and mocking.. List of unit testing frameworks available in .NET - NUnit, xUnit.net, Visual Studio unit test framework. List of mocking frameworks available in .NET - Moq, Rhino Mocks, FakeItEasy, NSubstitue, JustMock, and TypeMock. Introduction to Visual Studio Unit Testing Framework, NUnit and xUnit.net.
This document provides an overview of Jest, a JavaScript testing framework built by Facebook. It discusses Jest's features like testing, mocking, snapshots, and best practices. Key features include built-in support for mocking, coverage, isolation, and watch mode. It also covers how to write tests with Jest including describing tests, modifiers, setup/teardown, and mocking modules, objects, functions, and timers.
The document discusses Google Test, an open source unit testing framework for C++ that can also be used for testing C code, providing an overview of its features and how to implement unit tests using common patterns like test fixtures, assertions, and death tests to validate expected failures. It also covers best practices for writing effective unit tests, including keeping tests independent, focused, and fast-running.
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Victor Rentea
Are you in a mood for a brainstorm? Join this critical review of the major decisions taken in a typical enterprise application architecture and learn to balance pragmatism with your design goals. Find out how to do just-in-time design to keep as much use-cases as simple as possible. The core purpose of this presentation is to learn to strike a **balance between pragmatism and maintainability** in your design. Without continuous refactoring, a simple design will inevitably degenerate into a Big Ball of Mud, under the assault of the new features and bugfixes. On the other hand, very highly-factored code can burden the take-off of the development and end up freezing the mindset in some rigid 'a-priori' design. The end goal of this talk is to challenge you to rethink critically the architecture of your own systems, and seek ways to simplify it to match your actual needs, with a pragmatic mindset. "Architecture is the art of postponing decisions", said Uncle Bob. This talk takes this idea further and explains an optimal mindset about designing enterprise applications: Evolving (Continuously Refactoring) a Pragmatic (Simple), Clean (aka Onion) Architecture, aiming to provide Developer Safety™️ and Comfort™️. It’s the philosophy that Victor distilled over the past 5 years, designing and implementing 9 applications as IBM Lead Architect, and delivering trainings and advises to many other companies. You’ll learn how to break data into pieces (Fit Entities, Value Objects, Data Transfer Objects), how to keep the logic simple (Facades, Domain Services, logic extraction patterns, Mappers, AOP), layering to enforce boundaries (keeping DTOs out of your logic, Dependency Inversion Principle), and many more, all in a dynamic, interactive and extremely entertaining session.
Unit testing involves writing code to test individual units or components of an application to ensure they operate as intended. A unit test targets a specific function or class and ensures the code works correctly. A test suite is a collection of test cases that test a module. Frameworks like JUnit simplify the unit testing process and allow for test automation. JUnit tests are created in the same project structure with a "Test" suffix and use annotations to define test cases and suites. Tests can then be run and results analyzed to measure code coverage.
The document discusses various unit testing frameworks for .NET such as MSTest v2, NUnit, and xUnit.net. It provides information on the key features of each framework, how to install and set them up, how to write tests, and comparisons between the frameworks. The document recommends NUnit as it has the richest set of assertions, supports data-driven testing well, and has full documentation available, which would be important for a new development team to learn to use the framework effectively.
This document summarizes a presentation about using CucumberJS, WebDriverIO, and Docker for behavior-driven development (BDD) and continuous integration (CI). It discusses using CucumberJS with Gherkin syntax to write automated test cases in a business-readable format. WebDriverIO is introduced as a framework for automating tests in Node.js. The presentation demonstrates setting up a WebDriverIO project, running tests in Docker containers, and integrating everything with Travis CI for continuous testing. Code examples are provided for configuring WebDriverIO to use Docker services and setting up Docker containers in a Travis CI configuration file.
Unit Testing Concepts and Best PracticesDerek Smith
Unit testing involves writing code to test individual units or components of an application to ensure they perform as expected. The document discusses best practices for unit testing including writing atomic, consistent, self-descriptive tests with clear assertions. Tests should be separated by business module and type and not include conditional logic, loops, or exception handling. Production code should be isolated from test code. The goal of unit testing is to validate that code meets specifications and prevents regressions over time.
The document discusses Lighthouse, a tool for auditing web page performance. It introduces the RAIL model for measuring performance from a user perspective. Lighthouse automates performance testing using metrics based on RAIL like First Contentful Paint. The document then discusses how one company uses Lighthouse reports to monitor and improve the front-end performance of their product over time by addressing opportunities and detecting issues. Future work includes verifying performance in the real world using collected user data.
Start your app the better way with Styled SystemHsin-Hao Tang
The document introduces Styled System, a library that provides utility functions for styling React components in a consistent and mobile-first way. It allows creating component styles with concise code through functions that map prop values to CSS properties. Styled System also supports defining global themes and component variants to customize styles. Responsive designs can be implemented with an array syntax for breakpoints. Overall, Styled System promotes consistency, reusability and ease of customization for component library styles.
Build a better UI component library with Styled SystemHsin-Hao Tang
Build a better UI component library with Styled System by using utility functions that respond to changing requirements quickly. Styled System provides consistency by utilizing global theming and variants to define component styles. It also solves issues of inconsistent props and name collisions by leveraging color utilities and scoped CSS. Additionally, Styled System enables creating mobile-first responsive designs easily through array syntax for responsive styles.
37. Test Hooks
before: browser => {
// Test Suite 開始前執行
},
after: browser => {
// Test Suite 結束後執行
},
beforeEach: browser => {
// 在 Test Case 開始前執行
},
afterEach: (browser, done) => {
// 在 Test Case 結束後執行
done();
}
47. 禁跑特定測試
禁跑特定 Test Case:在 Test Case 前加上一個空字串
module.exports = {
'sample test': function (client) { // 會跑這個 Test Case
// ...
},
'other sample test': '' + function (client) {
// 加上空字串,禁跑特定 Test Case
}
};