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
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
Transcript
43 slides
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
More Decks by Ramona Schwering
See All by Ramona Schwering
Artful Defense
leichteckig
0
150
a11y club: The Cake Is a Lie... And So Is Your Login’s a11y.
leichteckig
0
25
Dangerous Reactivity: Why AI Output Is the New XSS Vue
leichteckig
0
49
React with Caution: How to Hack Your React App (And Fix It Too)
leichteckig
0
37
Vue'tiful Defense
leichteckig
0
190
Workshop: The Cake is a Lie!
leichteckig
0
50
The Cake Is a Lie... And So Is Your Login’s Accessibility
leichteckig
0
260
Plants vs thieves: Automated Tests in the World of Web Security
leichteckig
0
250
From the Crypt to the Code
leichteckig
0
270
Other Decks in Programming
See All in Programming
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
640
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
110
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
220
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
170
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
[DroidKnights 2026] Workflow AX 적용기 — 자동 정책 정리부터 E2E까지
dayeon
0
120
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
250
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
200
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
200
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
400
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.4k
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
2
800
Writing Fast Ruby
sferik
630
63k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
840
Bash Introduction
62gerente
615
220k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
The Language of Interfaces
destraynor
162
27k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
How GitHub (no longer) Works
holman
316
150k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
We Have a Design System, Now What?
morganepeng
55
8.4k