@lowdefy/blocks-antd 4.6.0 → 4.7.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/blocks/Affix/e2e.js +2 -2
- package/dist/blocks/Alert/e2e.js +2 -2
- package/dist/blocks/AutoComplete/e2e.js +3 -3
- package/dist/blocks/Avatar/e2e.js +2 -2
- package/dist/blocks/Badge/e2e.js +2 -2
- package/dist/blocks/Breadcrumb/e2e.js +2 -2
- package/dist/blocks/Button/e2e.js +2 -2
- package/dist/blocks/ButtonSelector/e2e.js +2 -2
- package/dist/blocks/Card/e2e.js +2 -2
- package/dist/blocks/Carousel/e2e.js +2 -2
- package/dist/blocks/CheckboxSelector/e2e.js +2 -2
- package/dist/blocks/CheckboxSwitch/e2e.js +3 -3
- package/dist/blocks/Collapse/e2e.js +2 -2
- package/dist/blocks/Comment/e2e.js +2 -2
- package/dist/blocks/Content/e2e.js +2 -2
- package/dist/blocks/ControlledList/e2e.js +4 -4
- package/dist/blocks/DateRangeSelector/e2e.js +73 -2
- package/dist/blocks/DateSelector/e2e.js +61 -3
- package/dist/blocks/DateTimeSelector/e2e.js +77 -3
- package/dist/blocks/Descriptions/e2e.js +2 -2
- package/dist/blocks/Divider/e2e.js +2 -2
- package/dist/blocks/Footer/e2e.js +2 -2
- package/dist/blocks/Header/e2e.js +2 -2
- package/dist/blocks/Label/e2e.js +2 -2
- package/dist/blocks/Layout/e2e.js +2 -2
- package/dist/blocks/Menu/e2e.js +2 -2
- package/dist/blocks/MobileMenu/e2e.js +2 -2
- package/dist/blocks/MonthSelector/e2e.js +33 -3
- package/dist/blocks/MultipleSelector/e2e.js +2 -2
- package/dist/blocks/NumberInput/e2e.js +2 -2
- package/dist/blocks/PageHeaderMenu/e2e.js +3 -3
- package/dist/blocks/PageSiderMenu/e2e.js +2 -2
- package/dist/blocks/Pagination/e2e.js +2 -2
- package/dist/blocks/Paragraph/e2e.js +2 -2
- package/dist/blocks/ParagraphInput/e2e.js +2 -2
- package/dist/blocks/PasswordInput/e2e.js +2 -2
- package/dist/blocks/PhoneNumberInput/e2e.js +2 -2
- package/dist/blocks/Popover/e2e.js +2 -2
- package/dist/blocks/Progress/e2e.js +2 -2
- package/dist/blocks/RadioSelector/e2e.js +2 -2
- package/dist/blocks/RatingSlider/e2e.js +3 -3
- package/dist/blocks/Result/e2e.js +2 -2
- package/dist/blocks/Selector/e2e.js +2 -2
- package/dist/blocks/Sider/e2e.js +2 -2
- package/dist/blocks/Slider/e2e.js +3 -3
- package/dist/blocks/Statistic/e2e.js +2 -2
- package/dist/blocks/Switch/e2e.js +2 -2
- package/dist/blocks/Tabs/e2e.js +2 -2
- package/dist/blocks/Tag/e2e.js +2 -2
- package/dist/blocks/TextArea/e2e.js +2 -2
- package/dist/blocks/TextInput/e2e.js +2 -2
- package/dist/blocks/TimelineList/e2e.js +2 -2
- package/dist/blocks/Title/e2e.js +2 -2
- package/dist/blocks/TitleInput/e2e.js +2 -2
- package/dist/blocks/Tooltip/e2e.js +2 -2
- package/dist/blocks/TreeSelector/e2e.js +2 -2
- package/dist/blocks/WeekSelector/e2e.js +61 -3
- package/package.json +6 -6
package/dist/blocks/Affix/e2e.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
package/dist/blocks/Alert/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-alert`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-alert`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-select:has(#${blockId}_input)`);
|
|
18
|
-
const input = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-select:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
21
21
|
do: {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
package/dist/blocks/Badge/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-btn`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-btn`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
package/dist/blocks/Card/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-carousel`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-carousel`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator,
|
|
19
19
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
18
|
-
const wrapper = (page, blockId)=>page.locator(`#bl-${blockId} .ant-checkbox-wrapper`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
|
+
const wrapper = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-checkbox-wrapper`);
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
21
21
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-collapse`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-collapse`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-layout-content`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-layout-content`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
21
|
-
add: (page, blockId)=>page.locator(`#${blockId}_add_button`).click(),
|
|
22
|
-
remove: (page, blockId, index)=>page.locator(`#${blockId}_${index}_remove_icon`).click()
|
|
21
|
+
add: (page, blockId)=>page.locator(`#${escapeId(blockId)}_add_button`).click(),
|
|
22
|
+
remove: (page, blockId, index)=>page.locator(`#${escapeId(blockId)}_${index}_remove_icon`).click()
|
|
23
23
|
},
|
|
24
24
|
expect: {
|
|
25
25
|
itemCount: (page, blockId, count)=>expect(locator(page, blockId).locator('.ant-list-item')).toHaveCount(count)
|
|
@@ -12,15 +12,86 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
import { expect } from '@playwright/test';
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker-range:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const startInput = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
const endInput = (page, blockId)=>locator(page, blockId).locator('.ant-picker-input').last().locator('input');
|
|
20
|
+
const monthNames = [
|
|
21
|
+
'Jan',
|
|
22
|
+
'Feb',
|
|
23
|
+
'Mar',
|
|
24
|
+
'Apr',
|
|
25
|
+
'May',
|
|
26
|
+
'Jun',
|
|
27
|
+
'Jul',
|
|
28
|
+
'Aug',
|
|
29
|
+
'Sep',
|
|
30
|
+
'Oct',
|
|
31
|
+
'Nov',
|
|
32
|
+
'Dec'
|
|
33
|
+
];
|
|
34
|
+
const navigateToMonth = async (dropdown, targetYear, targetMonth)=>{
|
|
35
|
+
const headerView = dropdown.locator('.ant-picker-header-view').first();
|
|
36
|
+
while(true){
|
|
37
|
+
const headerText = await headerView.textContent();
|
|
38
|
+
const yearMatch = headerText.match(/\d{4}/);
|
|
39
|
+
if (!yearMatch) {
|
|
40
|
+
throw new Error(`Could not parse year from picker header: "${headerText}"`);
|
|
41
|
+
}
|
|
42
|
+
const currentYear = parseInt(yearMatch[0], 10);
|
|
43
|
+
if (currentYear === targetYear) break;
|
|
44
|
+
if (currentYear > targetYear) {
|
|
45
|
+
await dropdown.locator('.ant-picker-header-super-prev-btn').first().click();
|
|
46
|
+
} else {
|
|
47
|
+
await dropdown.locator('.ant-picker-header-super-next-btn').first().click();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
while(true){
|
|
51
|
+
const headerText = await headerView.textContent();
|
|
52
|
+
const currentMonthName = monthNames.find((m)=>headerText.includes(m));
|
|
53
|
+
if (!currentMonthName) {
|
|
54
|
+
throw new Error(`Could not parse month from picker header: "${headerText}"`);
|
|
55
|
+
}
|
|
56
|
+
const currentMonth = monthNames.indexOf(currentMonthName) + 1;
|
|
57
|
+
if (currentMonth === targetMonth) break;
|
|
58
|
+
if (currentMonth > targetMonth) {
|
|
59
|
+
await dropdown.locator('.ant-picker-header-prev-btn').first().click();
|
|
60
|
+
} else {
|
|
61
|
+
await dropdown.locator('.ant-picker-header-next-btn').first().click();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
17
65
|
export default createBlockHelper({
|
|
18
66
|
locator,
|
|
19
67
|
do: {
|
|
20
68
|
open: (page, blockId)=>locator(page, blockId).click(),
|
|
69
|
+
fill: async (page, blockId, startVal, endVal)=>{
|
|
70
|
+
await startInput(page, blockId).click();
|
|
71
|
+
await page.keyboard.type(startVal);
|
|
72
|
+
await page.keyboard.press('Enter');
|
|
73
|
+
await endInput(page, blockId).click();
|
|
74
|
+
await page.keyboard.type(endVal);
|
|
75
|
+
await page.keyboard.press('Enter');
|
|
76
|
+
},
|
|
77
|
+
select: async (page, blockId, startDateStr, endDateStr)=>{
|
|
78
|
+
const [sYear, sMonth] = startDateStr.split('-').map(Number);
|
|
79
|
+
const [eYear, eMonth] = endDateStr.split('-').map(Number);
|
|
80
|
+
await startInput(page, blockId).click();
|
|
81
|
+
const dropdown = page.locator('.ant-picker-dropdown:visible');
|
|
82
|
+
await expect(dropdown).toBeVisible();
|
|
83
|
+
await navigateToMonth(dropdown, sYear, sMonth);
|
|
84
|
+
await dropdown.locator(`.ant-picker-cell-in-view[title="${startDateStr}"]`).click();
|
|
85
|
+
await navigateToMonth(dropdown, eYear, eMonth);
|
|
86
|
+
await dropdown.locator(`.ant-picker-cell-in-view[title="${endDateStr}"]`).click();
|
|
87
|
+
},
|
|
21
88
|
clear: async (page, blockId)=>{
|
|
22
89
|
await locator(page, blockId).hover();
|
|
23
90
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
24
91
|
}
|
|
92
|
+
},
|
|
93
|
+
expect: {
|
|
94
|
+
startValue: (page, blockId, val)=>expect(startInput(page, blockId)).toHaveValue(val),
|
|
95
|
+
endValue: (page, blockId, val)=>expect(endInput(page, blockId)).toHaveValue(val)
|
|
25
96
|
}
|
|
26
97
|
});
|
|
@@ -12,14 +12,72 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${blockId}_input)`);
|
|
18
|
-
const input = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
const monthNames = [
|
|
20
|
+
'Jan',
|
|
21
|
+
'Feb',
|
|
22
|
+
'Mar',
|
|
23
|
+
'Apr',
|
|
24
|
+
'May',
|
|
25
|
+
'Jun',
|
|
26
|
+
'Jul',
|
|
27
|
+
'Aug',
|
|
28
|
+
'Sep',
|
|
29
|
+
'Oct',
|
|
30
|
+
'Nov',
|
|
31
|
+
'Dec'
|
|
32
|
+
];
|
|
33
|
+
const navigateToMonth = async (dropdown, targetYear, targetMonth)=>{
|
|
34
|
+
const headerView = dropdown.locator('.ant-picker-header-view');
|
|
35
|
+
while(true){
|
|
36
|
+
const headerText = await headerView.textContent();
|
|
37
|
+
const yearMatch = headerText.match(/\d{4}/);
|
|
38
|
+
if (!yearMatch) {
|
|
39
|
+
throw new Error(`Could not parse year from picker header: "${headerText}"`);
|
|
40
|
+
}
|
|
41
|
+
const currentYear = parseInt(yearMatch[0], 10);
|
|
42
|
+
if (currentYear === targetYear) break;
|
|
43
|
+
if (currentYear > targetYear) {
|
|
44
|
+
await dropdown.locator('.ant-picker-header-super-prev-btn').click();
|
|
45
|
+
} else {
|
|
46
|
+
await dropdown.locator('.ant-picker-header-super-next-btn').click();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
while(true){
|
|
50
|
+
const headerText = await headerView.textContent();
|
|
51
|
+
const currentMonthName = monthNames.find((m)=>headerText.includes(m));
|
|
52
|
+
if (!currentMonthName) {
|
|
53
|
+
throw new Error(`Could not parse month from picker header: "${headerText}"`);
|
|
54
|
+
}
|
|
55
|
+
const currentMonth = monthNames.indexOf(currentMonthName) + 1;
|
|
56
|
+
if (currentMonth === targetMonth) break;
|
|
57
|
+
if (currentMonth > targetMonth) {
|
|
58
|
+
await dropdown.locator('.ant-picker-header-prev-btn').click();
|
|
59
|
+
} else {
|
|
60
|
+
await dropdown.locator('.ant-picker-header-next-btn').click();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
19
64
|
export default createBlockHelper({
|
|
20
65
|
locator,
|
|
21
66
|
do: {
|
|
22
67
|
open: (page, blockId)=>locator(page, blockId).click(),
|
|
68
|
+
fill: async (page, blockId, val)=>{
|
|
69
|
+
await input(page, blockId).click();
|
|
70
|
+
await page.keyboard.type(val);
|
|
71
|
+
await page.keyboard.press('Enter');
|
|
72
|
+
},
|
|
73
|
+
select: async (page, blockId, dateString)=>{
|
|
74
|
+
const [year, month] = dateString.split('-').map(Number);
|
|
75
|
+
await locator(page, blockId).click();
|
|
76
|
+
const dropdown = page.locator('.ant-picker-dropdown:visible');
|
|
77
|
+
await expect(dropdown).toBeVisible();
|
|
78
|
+
await navigateToMonth(dropdown, year, month);
|
|
79
|
+
await dropdown.locator(`.ant-picker-cell-in-view[title="${dateString}"]`).click();
|
|
80
|
+
},
|
|
23
81
|
clear: async (page, blockId)=>{
|
|
24
82
|
await locator(page, blockId).hover();
|
|
25
83
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
@@ -12,14 +12,88 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${blockId}_input)`);
|
|
18
|
-
const input = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
const monthNames = [
|
|
20
|
+
'Jan',
|
|
21
|
+
'Feb',
|
|
22
|
+
'Mar',
|
|
23
|
+
'Apr',
|
|
24
|
+
'May',
|
|
25
|
+
'Jun',
|
|
26
|
+
'Jul',
|
|
27
|
+
'Aug',
|
|
28
|
+
'Sep',
|
|
29
|
+
'Oct',
|
|
30
|
+
'Nov',
|
|
31
|
+
'Dec'
|
|
32
|
+
];
|
|
33
|
+
const navigateToMonth = async (dropdown, targetYear, targetMonth)=>{
|
|
34
|
+
const datePanel = dropdown.locator('.ant-picker-date-panel');
|
|
35
|
+
const headerView = datePanel.locator('.ant-picker-header-view');
|
|
36
|
+
while(true){
|
|
37
|
+
const headerText = await headerView.textContent();
|
|
38
|
+
const yearMatch = headerText.match(/\d{4}/);
|
|
39
|
+
if (!yearMatch) {
|
|
40
|
+
throw new Error(`Could not parse year from picker header: "${headerText}"`);
|
|
41
|
+
}
|
|
42
|
+
const currentYear = parseInt(yearMatch[0], 10);
|
|
43
|
+
if (currentYear === targetYear) break;
|
|
44
|
+
if (currentYear > targetYear) {
|
|
45
|
+
await datePanel.locator('.ant-picker-header-super-prev-btn').click();
|
|
46
|
+
} else {
|
|
47
|
+
await datePanel.locator('.ant-picker-header-super-next-btn').click();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
while(true){
|
|
51
|
+
const headerText = await headerView.textContent();
|
|
52
|
+
const currentMonthName = monthNames.find((m)=>headerText.includes(m));
|
|
53
|
+
if (!currentMonthName) {
|
|
54
|
+
throw new Error(`Could not parse month from picker header: "${headerText}"`);
|
|
55
|
+
}
|
|
56
|
+
const currentMonth = monthNames.indexOf(currentMonthName) + 1;
|
|
57
|
+
if (currentMonth === targetMonth) break;
|
|
58
|
+
if (currentMonth > targetMonth) {
|
|
59
|
+
await datePanel.locator('.ant-picker-header-prev-btn').click();
|
|
60
|
+
} else {
|
|
61
|
+
await datePanel.locator('.ant-picker-header-next-btn').click();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
19
65
|
export default createBlockHelper({
|
|
20
66
|
locator,
|
|
21
67
|
do: {
|
|
22
68
|
open: (page, blockId)=>locator(page, blockId).click(),
|
|
69
|
+
fill: async (page, blockId, val)=>{
|
|
70
|
+
await input(page, blockId).click();
|
|
71
|
+
await page.keyboard.type(val);
|
|
72
|
+
await page.keyboard.press('Enter');
|
|
73
|
+
},
|
|
74
|
+
select: async (page, blockId, dateTimeString)=>{
|
|
75
|
+
const [datePart, timePart] = dateTimeString.split(' ');
|
|
76
|
+
const [year, month] = datePart.split('-').map(Number);
|
|
77
|
+
await locator(page, blockId).click();
|
|
78
|
+
const dropdown = page.locator('.ant-picker-dropdown:visible');
|
|
79
|
+
await expect(dropdown).toBeVisible();
|
|
80
|
+
await navigateToMonth(dropdown, year, month);
|
|
81
|
+
await dropdown.locator(`.ant-picker-cell-in-view[title="${datePart}"]`).click();
|
|
82
|
+
if (timePart) {
|
|
83
|
+
const [hour, minute] = timePart.split(':');
|
|
84
|
+
const columns = dropdown.locator('.ant-picker-time-panel-column');
|
|
85
|
+
// Select hour
|
|
86
|
+
await columns.nth(0).locator(`li`).filter({
|
|
87
|
+
hasText: new RegExp(`^${hour}$`)
|
|
88
|
+
}).click();
|
|
89
|
+
// Select minute
|
|
90
|
+
await columns.nth(1).locator(`li`).filter({
|
|
91
|
+
hasText: new RegExp(`^${minute}$`)
|
|
92
|
+
}).click();
|
|
93
|
+
// Click OK to confirm
|
|
94
|
+
await dropdown.locator('.ant-picker-ok button').click();
|
|
95
|
+
}
|
|
96
|
+
},
|
|
23
97
|
clear: async (page, blockId)=>{
|
|
24
98
|
await locator(page, blockId).hover();
|
|
25
99
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-descriptions`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-descriptions`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-divider`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-divider`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-layout-footer`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-layout-footer`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-layout-header`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-layout-header`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
package/dist/blocks/Label/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-layout`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-layout`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
package/dist/blocks/Menu/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
// Menu items render inside a Drawer portal, not inside #bl-${blockId}.
|
|
19
19
|
const drawerMenu = (page)=>page.locator('.ant-drawer .ant-menu');
|
|
20
20
|
export default createBlockHelper({
|
|
@@ -12,14 +12,44 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${blockId}_input)`);
|
|
18
|
-
const input = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
const navigateToYear = async (dropdown, targetYear)=>{
|
|
20
|
+
const headerView = dropdown.locator('.ant-picker-header-view');
|
|
21
|
+
while(true){
|
|
22
|
+
const headerText = await headerView.textContent();
|
|
23
|
+
const yearMatch = headerText.match(/\d{4}/);
|
|
24
|
+
if (!yearMatch) {
|
|
25
|
+
throw new Error(`Could not parse year from picker header: "${headerText}"`);
|
|
26
|
+
}
|
|
27
|
+
const currentYear = parseInt(yearMatch[0], 10);
|
|
28
|
+
if (currentYear === targetYear) break;
|
|
29
|
+
if (currentYear > targetYear) {
|
|
30
|
+
await dropdown.locator('.ant-picker-header-super-prev-btn').click();
|
|
31
|
+
} else {
|
|
32
|
+
await dropdown.locator('.ant-picker-header-super-next-btn').click();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
19
36
|
export default createBlockHelper({
|
|
20
37
|
locator,
|
|
21
38
|
do: {
|
|
22
39
|
open: (page, blockId)=>locator(page, blockId).click(),
|
|
40
|
+
fill: async (page, blockId, val)=>{
|
|
41
|
+
await input(page, blockId).click();
|
|
42
|
+
await page.keyboard.type(val);
|
|
43
|
+
await page.keyboard.press('Enter');
|
|
44
|
+
},
|
|
45
|
+
select: async (page, blockId, monthString)=>{
|
|
46
|
+
const [year] = monthString.split('-').map(Number);
|
|
47
|
+
await locator(page, blockId).click();
|
|
48
|
+
const dropdown = page.locator('.ant-picker-dropdown:visible');
|
|
49
|
+
await expect(dropdown).toBeVisible();
|
|
50
|
+
await navigateToYear(dropdown, year);
|
|
51
|
+
await dropdown.locator(`.ant-picker-cell-in-view[title="${monthString}"]`).click();
|
|
52
|
+
},
|
|
23
53
|
clear: async (page, blockId)=>{
|
|
24
54
|
await locator(page, blockId).hover();
|
|
25
55
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-select:has(#${blockId}_input)`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-select:has(#${escapeId(blockId)}_input)`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
21
21
|
clickMenuItem: (page, blockId, menuItemText)=>locator(page, blockId).locator('.ant-menu-item').filter({
|
|
22
22
|
hasText: menuItemText
|
|
23
23
|
}).click(),
|
|
24
|
-
clickLogo: (page, blockId)=>locator(page, blockId).locator(`#${blockId}_header`).locator('a').first().click()
|
|
24
|
+
clickLogo: (page, blockId)=>locator(page, blockId).locator(`#${escapeId(blockId)}_header`).locator('a').first().click()
|
|
25
25
|
},
|
|
26
26
|
expect: {
|
|
27
27
|
menuItemActive: (page, blockId, menuItemText)=>expect(locator(page, blockId).locator('.ant-menu-item-selected').filter({
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-pagination`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-pagination`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-typography`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-typography`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
17
|
// Locator targets the trigger wrapper. The overlay is a portal (.ant-popover).
|
|
18
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
18
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
21
21
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-slider`);
|
|
18
|
-
const handle = (page, blockId)=>page.locator(`#bl-${blockId} .ant-slider-handle`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-slider`);
|
|
18
|
+
const handle = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-slider-handle`);
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
21
21
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
const resultLocator = (page, blockId)=>locator(page, blockId).locator('.ant-result');
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-select:has(#${blockId}_input)`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-select:has(#${escapeId(blockId)}_input)`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
package/dist/blocks/Sider/e2e.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
16
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-layout-sider`);
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-layout-sider`);
|
|
17
17
|
export default createBlockHelper({
|
|
18
18
|
locator
|
|
19
19
|
});
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-slider`);
|
|
18
|
-
const handle = (page, blockId)=>page.locator(`#bl-${blockId} .ant-slider-handle`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-slider`);
|
|
18
|
+
const handle = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-slider-handle`);
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
21
21
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
package/dist/blocks/Tabs/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-tabs`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-tabs`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
package/dist/blocks/Tag/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-tag`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-tag`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
package/dist/blocks/Title/e2e.js
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#${blockId}`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#${escapeId(blockId)}`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
expect: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-typography`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-typography`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
17
|
// Locator targets the trigger wrapper. The overlay is a portal (.ant-tooltip).
|
|
18
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId}`);
|
|
18
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)}`);
|
|
19
19
|
export default createBlockHelper({
|
|
20
20
|
locator,
|
|
21
21
|
do: {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`#bl-${blockId} .ant-tree`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`#bl-${escapeId(blockId)} .ant-tree`);
|
|
18
18
|
export default createBlockHelper({
|
|
19
19
|
locator,
|
|
20
20
|
do: {
|
|
@@ -12,14 +12,72 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { createBlockHelper } from '@lowdefy/e2e-utils';
|
|
15
|
+
*/ import { createBlockHelper, escapeId } from '@lowdefy/e2e-utils';
|
|
16
16
|
import { expect } from '@playwright/test';
|
|
17
|
-
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${blockId}_input)`);
|
|
18
|
-
const input = (page, blockId)=>page.locator(`#${blockId}_input`);
|
|
17
|
+
const locator = (page, blockId)=>page.locator(`.ant-picker:has(#${escapeId(blockId)}_input)`);
|
|
18
|
+
const input = (page, blockId)=>page.locator(`#${escapeId(blockId)}_input`);
|
|
19
|
+
const monthNames = [
|
|
20
|
+
'Jan',
|
|
21
|
+
'Feb',
|
|
22
|
+
'Mar',
|
|
23
|
+
'Apr',
|
|
24
|
+
'May',
|
|
25
|
+
'Jun',
|
|
26
|
+
'Jul',
|
|
27
|
+
'Aug',
|
|
28
|
+
'Sep',
|
|
29
|
+
'Oct',
|
|
30
|
+
'Nov',
|
|
31
|
+
'Dec'
|
|
32
|
+
];
|
|
33
|
+
const navigateToMonth = async (dropdown, targetYear, targetMonth)=>{
|
|
34
|
+
const headerView = dropdown.locator('.ant-picker-header-view');
|
|
35
|
+
while(true){
|
|
36
|
+
const headerText = await headerView.textContent();
|
|
37
|
+
const yearMatch = headerText.match(/\d{4}/);
|
|
38
|
+
if (!yearMatch) {
|
|
39
|
+
throw new Error(`Could not parse year from picker header: "${headerText}"`);
|
|
40
|
+
}
|
|
41
|
+
const currentYear = parseInt(yearMatch[0], 10);
|
|
42
|
+
if (currentYear === targetYear) break;
|
|
43
|
+
if (currentYear > targetYear) {
|
|
44
|
+
await dropdown.locator('.ant-picker-header-super-prev-btn').click();
|
|
45
|
+
} else {
|
|
46
|
+
await dropdown.locator('.ant-picker-header-super-next-btn').click();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
while(true){
|
|
50
|
+
const headerText = await headerView.textContent();
|
|
51
|
+
const currentMonthName = monthNames.find((m)=>headerText.includes(m));
|
|
52
|
+
if (!currentMonthName) {
|
|
53
|
+
throw new Error(`Could not parse month from picker header: "${headerText}"`);
|
|
54
|
+
}
|
|
55
|
+
const currentMonth = monthNames.indexOf(currentMonthName) + 1;
|
|
56
|
+
if (currentMonth === targetMonth) break;
|
|
57
|
+
if (currentMonth > targetMonth) {
|
|
58
|
+
await dropdown.locator('.ant-picker-header-prev-btn').click();
|
|
59
|
+
} else {
|
|
60
|
+
await dropdown.locator('.ant-picker-header-next-btn').click();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
19
64
|
export default createBlockHelper({
|
|
20
65
|
locator,
|
|
21
66
|
do: {
|
|
22
67
|
open: (page, blockId)=>locator(page, blockId).click(),
|
|
68
|
+
fill: async (page, blockId, val)=>{
|
|
69
|
+
await input(page, blockId).click();
|
|
70
|
+
await page.keyboard.type(val);
|
|
71
|
+
await page.keyboard.press('Enter');
|
|
72
|
+
},
|
|
73
|
+
select: async (page, blockId, dateString)=>{
|
|
74
|
+
const [year, month] = dateString.split('-').map(Number);
|
|
75
|
+
await locator(page, blockId).click();
|
|
76
|
+
const dropdown = page.locator('.ant-picker-dropdown:visible');
|
|
77
|
+
await expect(dropdown).toBeVisible();
|
|
78
|
+
await navigateToMonth(dropdown, year, month);
|
|
79
|
+
await dropdown.locator(`.ant-picker-cell-in-view[title="${dateString}"]`).click();
|
|
80
|
+
},
|
|
23
81
|
clear: async (page, blockId)=>{
|
|
24
82
|
await locator(page, blockId).hover();
|
|
25
83
|
await locator(page, blockId).locator('.ant-picker-clear').click();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-antd",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy Ant Design Blocks",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@ant-design/icons": "4.8.0",
|
|
48
|
-
"@lowdefy/block-utils": "4.
|
|
49
|
-
"@lowdefy/helpers": "4.
|
|
48
|
+
"@lowdefy/block-utils": "4.7.1",
|
|
49
|
+
"@lowdefy/helpers": "4.7.1",
|
|
50
50
|
"antd": "4.24.14",
|
|
51
51
|
"classnames": "2.3.2",
|
|
52
52
|
"moment": "2.29.4",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"tinycolor2": "1.6.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@lowdefy/block-dev-e2e": "4.
|
|
60
|
-
"@lowdefy/e2e-utils": "4.
|
|
59
|
+
"@lowdefy/block-dev-e2e": "4.7.1",
|
|
60
|
+
"@lowdefy/e2e-utils": "4.7.1",
|
|
61
61
|
"@playwright/test": "1.50.1",
|
|
62
|
-
"@lowdefy/node-utils": "4.
|
|
62
|
+
"@lowdefy/node-utils": "4.7.1",
|
|
63
63
|
"@swc/cli": "0.1.63",
|
|
64
64
|
"@swc/core": "1.3.99",
|
|
65
65
|
"copyfiles": "2.4.1"
|