Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
It's a (testing) trap! - Common testing pitfall...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ramona Schwering
June 08, 2021
Programming
540
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
It's a (testing) trap! - Common testing pitfalls and how to solve them
Ramona Schwering
June 08, 2021
More Decks by Ramona Schwering
See All by Ramona Schwering
Artful Defense
leichteckig
0
82
a11y club: The Cake Is a Lie... And So Is Your Login’s a11y.
leichteckig
0
21
Dangerous Reactivity: Why AI Output Is the New XSS Vue
leichteckig
0
40
React with Caution: How to Hack Your React App (And Fix It Too)
leichteckig
0
28
Vue'tiful Defense
leichteckig
0
150
Workshop: The Cake is a Lie!
leichteckig
0
47
The Cake Is a Lie... And So Is Your Login’s Accessibility
leichteckig
0
250
Plants vs thieves: Automated Tests in the World of Web Security
leichteckig
0
240
From the Crypt to the Code
leichteckig
0
260
Other Decks in Programming
See All in Programming
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
4
3.5k
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
880
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
880
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
ActionController meets Protocol Buffers
sorah
0
520
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Speed Design
sergeychernyshev
33
2.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Crafting Experiences
bethany
1
380
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
How to Talk to Developers About Accessibility
jct
2
580
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
None
describe('deprecated.plugin', () => { it('should throw error',() => { …
}); });
describe('deprecated.plugin', () => { it('Property: Should throw an error if
the deprecated prop is used', () => { … }); });
None
describe('Context menu', () => { it('should open the context menu
on click', async () => { const wrapper = createWrapper(); expect(wrapper.vm).toBeTruthy(); await wrapper.trigger('click'); const selector = '.sw-context-menu'; expect(wrapper.find(selector).isVisible()).toBeTruthy(); }); });
describe('Context menu', () => { it('should open the context menu
on click', () => { }); });
describe('Context menu', () => { it('should open the context menu
on click', () => { }); }); // Arrange const wrapper = createWrapper(); const selector = '.sw-context-menu';
describe('Context menu', () => { it('should open the context menu
on click', () => { }); }); // Arrange const wrapper = createWrapper(); const selector = '.sw-context-menu'; // Act await wrapper.trigger('click');
describe('Context menu', () => { it('should open the context menu
on click', () => { }); }); // Arrange const wrapper = createWrapper(); const selector = '.sw-context-menu'; // Act await wrapper.trigger('click'); // Assert expect(wrapper.vm).toBeTruthy(); expect(wrapper.find(selector).isVisible()).toBeTruthy();
None
None
“…arrange my test == what I’m given.”
“…arrange my test == what I’m given.” “…act in my
test == when something happens.”
“…arrange my test == what I’m given.” “…act in my
test == when something happens.” “…assert the results == something happens then this is what I expect as the outcome.”
“…arrange my test == what I’m given.” “…act in my
test == when something happens.” “…assert the results == something happens then this is what I expect as the outcome.”
describe('Context menu', () => { it('should open the context menu
on click', () => { // Given const contextButtonSelector = 'sw-context-button'; const contextMenuSelector = '.sw-context-menu'; // When let contextMenu = wrapper.find(contextMenuSelector); expect(contextMenu.isVisible()).toBe(false); const contextButton = wrapper.find(contextButtonSelector); await contextButton.trigger('click'); // Then contextMenu = wrapper.find(contextMenuSelector); expect(contextMenu.isVisible()).toBe(true); }); });
None
None
it('should create and read product', () => { … cy.get('.sw-field—product-name').type('T-Shirt
Ackbar'); cy.get('.sw-select-product__select_manufacturer') .type('Space Company’); … });
it('should create and read product', () => { … cy.get('.sw-field—product-name').type('T-Shirt
Ackbar'); cy.get('.sw-select-product__select_manufacturer') .type('Space Company’); … });
None
None
None
Cypress.Commands.add('typeSingleSelect', { prevSubject: 'element', }, (subject, value, selector) => {
… cy.wait(500); cy.get(`${selector} input`) .type(value); });
None
None
None
None
None
None
None