मुख्य सामग्री पर जाएं

isStable (स्थिर है)

यह तब true लौटाएगा जब स्थिर हो (एनिमेशन में) या जब अस्थिर हो (एनिमेशन में नहीं)।

नोट: इस कमांड का उपयोग करने के बजाय एनिमेशन को अक्षम करना सबसे अच्छा है।

उपयोग
$(selector).isStable()
उदाहरण
index.html
<head>
<style>
div {
width: 200px;
height: 200px;
background-color: red;
}
#has-animation {
animation: 3s 0s alternate slidein;
}
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}

to {
margin-left: 0%;
width: 100%;
}
}
</style>
</head>

<body>
<div #has-animation></div>
<div #has-no-animation></div>
</body>

isStable.js
it('should detect if an element is stable', async () => {
let element = await $('#has-animation');
console.log(await element.isStable()); // outputs: false

element = await $('#has-no-animation')
console.log(await element.isStable()); // outputs: true
});
रिटर्न्स
  • <Boolean> return: true अगर एलिमेंट स्थिर है, false अगर अस्थिर है

Welcome! How can I help?

WebdriverIO AI Copilot