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
More Decks by Ramona Schwering
See All by Ramona Schwering
Artful Defense
leichteckig
0
37
a11y club: The Cake Is a Lie... And So Is Your Login’s a11y.
leichteckig
0
20
Dangerous Reactivity: Why AI Output Is the New XSS Vue
leichteckig
0
29
React with Caution: How to Hack Your React App (And Fix It Too)
leichteckig
0
24
Vue'tiful Defense
leichteckig
0
130
Workshop: The Cake is a Lie!
leichteckig
0
42
The Cake Is a Lie... And So Is Your Login’s Accessibility
leichteckig
0
230
Plants vs thieves: Automated Tests in the World of Web Security
leichteckig
0
230
From the Crypt to the Code
leichteckig
0
250
Other Decks in Programming
See All in Programming
XHTMLが残したもの
yosuke_furukawa
PRO
2
670
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
110
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
7
3.7k
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
550
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
120
Family mrubyの進捗
kishima
1
110
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
520
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
130
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
160
ALB ログから Trace を気合で繋げる技術
fohte
7
880
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
280
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
320
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
A Tale of Four Properties
chriscoyier
163
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
The Curse of the Amulet
leimatthew05
2
14k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
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