@lvce-editor/renderer-process 30.11.0 → 30.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rendererProcessMain.js +25 -9
- package/package.json +1 -1
|
@@ -4561,8 +4561,16 @@ const performAction2 = async (locator, fnName, options) => {
|
|
|
4561
4561
|
fn(element, options);
|
|
4562
4562
|
};
|
|
4563
4563
|
|
|
4564
|
+
const getParsedSelector = locator => {
|
|
4565
|
+
if (Array.isArray(locator)) {
|
|
4566
|
+
return locator;
|
|
4567
|
+
}
|
|
4568
|
+
return locator._parsed;
|
|
4569
|
+
};
|
|
4570
|
+
|
|
4564
4571
|
const getElementText = locator => {
|
|
4565
|
-
const
|
|
4572
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4573
|
+
const element = querySelectorOne(parsedSelector);
|
|
4566
4574
|
if (!element) {
|
|
4567
4575
|
return {
|
|
4568
4576
|
actual: '',
|
|
@@ -4584,7 +4592,8 @@ const toHaveAttribute$1 = (locator, {
|
|
|
4584
4592
|
key,
|
|
4585
4593
|
value
|
|
4586
4594
|
}) => {
|
|
4587
|
-
const
|
|
4595
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4596
|
+
const element = querySelectorOne(parsedSelector);
|
|
4588
4597
|
if (!element) {
|
|
4589
4598
|
return {
|
|
4590
4599
|
actual: '',
|
|
@@ -4598,7 +4607,8 @@ const toHaveAttribute$1 = (locator, {
|
|
|
4598
4607
|
};
|
|
4599
4608
|
};
|
|
4600
4609
|
const toHaveCount$1 = locator => {
|
|
4601
|
-
const
|
|
4610
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4611
|
+
const elements = querySelector(parsedSelector);
|
|
4602
4612
|
const actualCount = elements.length;
|
|
4603
4613
|
return {
|
|
4604
4614
|
actual: actualCount
|
|
@@ -4626,7 +4636,8 @@ const toBeFocused$1 = locator => {
|
|
|
4626
4636
|
const toHaveClass$1 = (locator, {
|
|
4627
4637
|
className
|
|
4628
4638
|
}) => {
|
|
4629
|
-
const
|
|
4639
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4640
|
+
const [element] = querySelector(parsedSelector);
|
|
4630
4641
|
if (!element) {
|
|
4631
4642
|
return {
|
|
4632
4643
|
actual: '',
|
|
@@ -4639,7 +4650,8 @@ const toHaveClass$1 = (locator, {
|
|
|
4639
4650
|
};
|
|
4640
4651
|
};
|
|
4641
4652
|
const toHaveId$1 = locator => {
|
|
4642
|
-
const
|
|
4653
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4654
|
+
const [element] = querySelector(parsedSelector);
|
|
4643
4655
|
if (!element) {
|
|
4644
4656
|
return {
|
|
4645
4657
|
actual: '',
|
|
@@ -4654,7 +4666,8 @@ const toHaveId$1 = locator => {
|
|
|
4654
4666
|
const toHaveCss$1 = (locator, {
|
|
4655
4667
|
key
|
|
4656
4668
|
}) => {
|
|
4657
|
-
const
|
|
4669
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4670
|
+
const [element] = querySelector(parsedSelector);
|
|
4658
4671
|
if (!element) {
|
|
4659
4672
|
return {
|
|
4660
4673
|
actual: '',
|
|
@@ -4671,7 +4684,8 @@ const toHaveCss$1 = (locator, {
|
|
|
4671
4684
|
const toHaveJSProperty$1 = (locator, {
|
|
4672
4685
|
key
|
|
4673
4686
|
}) => {
|
|
4674
|
-
const
|
|
4687
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4688
|
+
const [element] = querySelector(parsedSelector);
|
|
4675
4689
|
if (!element) {
|
|
4676
4690
|
return {
|
|
4677
4691
|
actual: '',
|
|
@@ -4947,7 +4961,8 @@ const performKeyboardAction = (fnName, options) => {
|
|
|
4947
4961
|
};
|
|
4948
4962
|
const checkSingleElementCondition = async (locator, fnName, options) => {
|
|
4949
4963
|
const fn = SingleElementConditions[fnName];
|
|
4950
|
-
const
|
|
4964
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4965
|
+
const element = querySelectorOne(parsedSelector);
|
|
4951
4966
|
if (element) {
|
|
4952
4967
|
const successful = fn(element, options);
|
|
4953
4968
|
if (successful) {
|
|
@@ -4962,7 +4977,8 @@ const checkSingleElementCondition = async (locator, fnName, options) => {
|
|
|
4962
4977
|
};
|
|
4963
4978
|
const checkMultiElementCondition = async (locator, fnName, options) => {
|
|
4964
4979
|
const fn = MultiElementConditions[fnName];
|
|
4965
|
-
const
|
|
4980
|
+
const parsedSelector = getParsedSelector(locator);
|
|
4981
|
+
const elements = querySelector(parsedSelector);
|
|
4966
4982
|
const successful = fn(elements, options);
|
|
4967
4983
|
if (successful) {
|
|
4968
4984
|
return {
|