Skip to content

Commit 0d8367b

Browse files
committed
Add recipe and UI test.
1 parent 6d3607c commit 0d8367b

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
extern alias OCCMA;
2+
using Lombiq.Tests.UI.Extensions;
3+
using Lombiq.Tests.UI.Services;
4+
using OpenQA.Selenium;
5+
using Shouldly;
6+
using System.Threading.Tasks;
7+
8+
namespace Lombiq.HelpfulExtensions.Tests.UI.Extensions;
9+
10+
public static class LiquidTestCaseUITestContextExtensions
11+
{
12+
/// <summary>
13+
/// Tests the Lombiq Helpful Extensions - Liquid feature.
14+
/// </summary>
15+
public static async Task TestLiquidFeatureAsync(this UITestContext context)
16+
{
17+
// Initialize relevant content.
18+
await context.SignInDirectlyAsync();
19+
await context.ExecuteRecipeDirectlyAsync("Lombiq.HelpfulExtensions.Liquid.Sample");
20+
21+
// Test the "ifnotempty" feature. If the evaluation works, we should see "HELLO![ FOO BAR true ]" with other
22+
// parts omitted (i.e. it shouldn't be "HELLO![ empty whitespace1 whitespace2 FOO BAR true false null empty ]").
23+
await context.GoToRelativeUrlAsync("/liquid-demo/ifnotempty");
24+
context.Get(By.Id("demo-value")).GetTextTrimmed().ShouldBe("HELLO![ FOO BAR true ]");
25+
}
26+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"name": "Lombiq.HelpfulExtensions.Liquid.Sample",
3+
"displayName": "Lombiq Helpful Extensions - Liquid - Sample",
4+
"description": "Sample Page content items to test the Liquid feature.",
5+
"author": "Lombiq Technologies",
6+
"website": "https://github.com/Lombiq/Helpful-Extensions/",
7+
"version": "1.0",
8+
"issetuprecipe": false,
9+
"categories": [
10+
"test"
11+
],
12+
"tags": [
13+
"test"
14+
],
15+
"steps": [
16+
{
17+
"name": "feature",
18+
"enable": [
19+
"Lombiq.HelpfulExtensions.Liquid"
20+
]
21+
},
22+
{
23+
"name": "content",
24+
"data": [
25+
{
26+
"ContentItemId": "liquiddemoifnotempty000000",
27+
"ContentItemVersionId": "4rzgdta6w5j54zntybm6ahgs4p",
28+
"ContentType": "Page",
29+
"DisplayText": "Liquid Demo: ifnotempty",
30+
"Latest": true,
31+
"Published": true,
32+
"ModifiedUtc": "2025-09-24T11:34:33.6433372Z",
33+
"PublishedUtc": "2025-09-24T11:34:33.6505706Z",
34+
"CreatedUtc": "2025-09-24T11:30:29.8819496Z",
35+
"Owner": null,
36+
"Author": "admin",
37+
"TitlePart": {
38+
"Title": "Liquid Demo: ifnotempty"
39+
},
40+
"AutoroutePart": {
41+
"SetHomepage": false,
42+
"Disabled": false,
43+
"RouteContainedItems": false,
44+
"Absolute": false,
45+
"Path": "liquid-demo/ifnotempty"
46+
},
47+
"FlowPart": {
48+
"Widgets": [
49+
{
50+
"ContentItemId": "468ndvpjrfxwa60kf2wmp8c5d6",
51+
"ContentItemVersionId": null,
52+
"ContentType": "LiquidWidget",
53+
"DisplayText": null,
54+
"Latest": false,
55+
"Published": false,
56+
"ModifiedUtc": "2025-09-24T11:34:33.6469974Z",
57+
"PublishedUtc": null,
58+
"CreatedUtc": null,
59+
"Owner": null,
60+
"Author": "admin",
61+
"LiquidPart": {
62+
"Liquid": "<div id=\"demo-value\">HELLO![\r\n\r\n{% ifnotempty \"\" %}\r\nempty\r\n{% endifnotempty %}\r\n{% ifnotempty \" \" %}\r\nwhitespace1\r\n{% endifnotempty %}\r\n{% ifnotempty \" \\n \\n \" %}\r\nwhitespace2\r\n{% endifnotempty %}\r\n{% ifnotempty \" foo \" %}\r\nFOO\r\n{% endifnotempty %}\r\n{% ifnotempty \" BAR \" %}\r\nBAR\r\n{% endifnotempty %}\r\n{% ifnotempty true %}\r\ntrue\r\n{% endifnotempty %}\r\n{% ifnotempty false %}\r\nfalse\r\n{% endifnotempty %}\r\n{% ifnotempty null %}\r\nnull\r\n{% endifnotempty %}\r\n{% ifnotempty empty %}\r\nempty\r\n{% endifnotempty %}\r\n\r\n]</div>"
63+
},
64+
"AdditionalStylingPart": {
65+
"RemoveGridExtensionClasses": false,
66+
"CustomClasses": null
67+
},
68+
"@WeldedPartSettings": {
69+
"AdditionalStylingPart": {}
70+
},
71+
"FlowMetadata": {
72+
"Alignment": "Justify",
73+
"Size": 100
74+
}
75+
}
76+
]
77+
},
78+
"Page": {}
79+
}
80+
]
81+
}
82+
]
83+
}

0 commit comments

Comments
 (0)