Skip to content

Commit a6eaecd

Browse files
committed
Add new E2E testRigor tests
1 parent 0cfbc78 commit a6eaecd

22 files changed

+432
-3
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
name: CI
55

6-
on: [pull_request]
6+
# on: [pull_request]
7+
8+
on:
9+
push:
10+
branches: [add-new-e2e-tests]
711

812
jobs:
913
unit-tests:
@@ -126,7 +130,7 @@ jobs:
126130
ports:
127131
- 4444:4444
128132
steps:
129-
- uses: actions/checkout@v2
133+
- uses: actions/checkout@v4
130134

131135
- name: Setup PHP
132136
uses: shivammathur/setup-php@master
@@ -136,7 +140,7 @@ jobs:
136140

137141
- name: Cache Composer packages
138142
id: composer-cache
139-
uses: actions/cache@v2
143+
uses: actions/cache@v4
140144
with:
141145
path: vendor
142146
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
@@ -150,4 +154,36 @@ jobs:
150154
- name: Run tests
151155
run: bin/functional
152156

157+
testrigor-tests:
158+
name: testRigor Tests
159+
runs-on: ubuntu-latest
160+
env:
161+
MAGENTO_TEST_SUITE_ID: ${{vars.MAGENTO_TEST_SUITE_ID}}
162+
MAGENTO_AUTH_TOKEN: ${{secrets.MAGENTO_AUTH_TOKEN}}
163+
LOCALHOST_URL: ${{vars.LOCALHOST_URL}}
153164

165+
steps:
166+
- uses: actions/checkout@v4
167+
168+
- name: Setup PHP
169+
uses: shivammathur/setup-php@master
170+
with:
171+
php-version: ${{ matrix.php-versions }}
172+
extensions: curl, dom, intl, json, openssl
173+
174+
- name: Cache Composer packages
175+
id: composer-cache
176+
uses: actions/cache@v4
177+
with:
178+
path: vendor
179+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
180+
restore-keys: |
181+
${{ runner.os }}-php-
182+
183+
- name: Install dependencies
184+
if: steps.composer-cache.outputs.cache-hit != 'true'
185+
run: composer install --prefer-dist --no-progress --no-suggest
186+
187+
- name: Run tests
188+
run: |
189+
sudo chmod +x bin/testrigor && bin/testrigor

bin/mftf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,28 @@ try {
2020
} else {
2121
require_once $testBootstrapPath;
2222
}
23+
echo 'Environment: ' . TEST_ENV . PHP_EOL;
24+
echo 'Base URL: ' . $testConfig['baseUrl'] . PHP_EOL;
25+
runTestRigor();
2326
} catch (\Exception $e) {
2427
echo 'Autoload error: ' . $e->getMessage();
2528
exit(1);
2629
}
2730

31+
// add testrigor into this script using the variable loaded on bootstrap
32+
33+
function runTestRigor()
34+
{
35+
36+
$testRigorScript = __DIR__ . '/../dev/tests/testRigor/testrigor.php';
37+
38+
if (file_exists($testRigorScript)) {
39+
require_once $testRigorScript;
40+
} else {
41+
echo "testRigor script not found at: $testRigorScript\n";
42+
exit(1);
43+
}
44+
}
2845

2946
try {
3047
$version = json_decode(file_get_contents(FW_BP . DIRECTORY_SEPARATOR . 'composer.json'), true);

bin/testrigor

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
echo "==============================="
3+
echo " EXECUTE testRigor Tests "
4+
echo "==============================="
5+
6+
echo "Building MFTF project..."
7+
bin/mftf build:project
8+
9+
echo "$MAGENTO_BASE_URL"
10+
11+
echo "Running testRigor tests..."
12+
chmod +x ./dev/tests/testRigor/testrigor && ./dev/tests/testRigor/testrigor

dev/tests/testRigor/Settings.yaml

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
monitoringIntervals: -1
2+
clickButtonOnlyOnce: false
3+
detectUiIssues: false
4+
axeCoreTestStrategy: DO_NOT_RUN
5+
maxAxeCoreErrorSeverity: MAJOR
6+
aiScreenshotTestStrategy: DO_NOT_RUN
7+
maxAiScreenshotTestErrorSeverity: BLOCKER
8+
screenRereadStrategy: UsePreviousVersion
9+
parentPathStrategy: AllPath
10+
useParallelCombinator: true
11+
maximumParallelServers: 10
12+
maxParallelBatchSize: 10
13+
allowedRecordedSessionTimeouts: 12
14+
maximumNumberOfAiFlows: 1
15+
appDescriptionForAi: "This is a e-commerce application selling fitness clothes and\
16+
\ gear for men and women. Users don't need to be logged in to search or add to cart,\
17+
\ but they must create an account and log in to finish purchases. Users can view\
18+
\ products prices, sizes and colors. Users should choose size and colors when adding\
19+
\ products to the cart. Users can either choose the size and colors of an item directly\
20+
\ on the search results page, or in the product details page. Users can filter products\
21+
\ by category. Users can add products to wishlist either on the search results page\
22+
\ or in the product details page. Users with an account can add items to compare\
23+
\ products either on the search results page or in the product details page. Users\
24+
\ can subscribe for a newsletter using e-mail. Users can purchase using a credit\
25+
\ card and address and view the purchase status as a registered user. Users can\
26+
\ edit their profile information. Users can write rated reviews on product pages\
27+
\ regarding the products. In addition, users may also use the platform to browse\
28+
\ featured on sale banners."
29+
maximumNumberOfFlows: 0
30+
maximumNumberOfRecordedTestCases: 10
31+
maximumFlowDepth: 16
32+
maximumRecordedFlowDepth: 16
33+
maximumWaitTimeout: 30
34+
maximumWaitTimeoutForConditionals: 3
35+
maximumDataLoadTimeout: 60
36+
maximumDownloadTimeout: 60
37+
maximumEmailWaitTime: 60
38+
waitForPageToRender: 0
39+
waitFirstPage: 0
40+
waitAfterLogin: 0
41+
waitAfterSearch: 0
42+
waitAfterDataEntry: 0
43+
waitBeforeDropdownReread: 100
44+
waitAfterScrolling: 0
45+
waitAfterScrollingBeforeGettingElementImage: 500
46+
waitAfterUploadClick: 1
47+
waitAfterFillingForm: 1000
48+
waitAfterSwitchingTab: 1000
49+
waitAfterPressingKeys: 50
50+
waitAfterPressingKeysAndroid: 0
51+
waitAfterDrag: 100
52+
waitAfterElementFoundBeforeEngaging: 50
53+
delayBetweenMouseClickActions: 50
54+
delayBetweenMouseDragAndDropActions: 400
55+
longClickDuration: 3
56+
retryIntervalTime: 500
57+
liveScreenshotRefreshIntervalTime: 3
58+
maximumNumerOfRetries: 0
59+
delayAfterHideKeyboard: 50
60+
ignoreElements: []
61+
ignoreElementsAtCompare: []
62+
alwaysTestAllElementsInLists: false
63+
includeAllElements: []
64+
customCookies: []
65+
extraHeaders: []
66+
customAttributes: []
67+
discoveryStrategy: DISCOVER
68+
screenRetestStrategy: LAST
69+
desktopWebClickStrategy: SELENIUM_JS
70+
recordTestExecutionVideo: false
71+
webSafariClickStrategy: JAVASCRIPT
72+
webLongTextSendsKeyStrategy: SEND_ALL
73+
retestTexts: ALL
74+
retestDataInputs: ALL
75+
retestControls: ALL
76+
retestLists: ALL
77+
testJavascriptErrors: NONE
78+
testCssFiles: NONE
79+
testImageFiles: NONE
80+
testJavascriptFiles: NONE
81+
testApiCalls: NONE
82+
testOtherFiles: NONE
83+
allowSubdomainsChange: ALLOW_ANY
84+
customDomains: []
85+
autoLaunchMobileApplication: AUTOMATIC
86+
mobileWebClickStrategy: CLICK
87+
mobileEnterStrategy: DEFAULT
88+
mobileKeyboardStrategy: CLICK_OUTSIDE
89+
androidKeyboardStrategy: NAVIGATE_BACK
90+
androidCloseKeyboardRetries: 3
91+
notificationStrategy: FULL
92+
enableEmailNotifications: true
93+
notificationsEmailMode: ALWAYS
94+
notificationsEmail: testing+magento@testrigor.com
95+
enableSlackNotifications: false
96+
notificationsSlackMode: ALWAYS
97+
enableMicrosoftTeamsNotifications: false
98+
notificationsMicrosoftTeamsMode: ALWAYS
99+
microsoftTeamsNotificationsEmail: ""
100+
allowAiButtonPrediction: false
101+
newTabsStrategy: SWITCH_TO_NEW
102+
dropdownDetectionStrategy: OPTIMISTIC
103+
elementPriorizationStrategy: MAX
104+
mobileAutoAcceptPermissions: false
105+
iosSimAppPermissions:
106+
enabled: false
107+
logLevel: DEBUG
108+
useRecordedData: true
109+
useRecordedFlowsWithXpaths: false
110+
jira:
111+
allowJiraIntegration: true
112+
pivotal:
113+
allowPivotalIntegration: false
114+
hiptest:
115+
allowHipTestIntegration: false
116+
codeGeneration:
117+
enabled: false
118+
testRail:
119+
enabled: false
120+
twilio: {}
121+
jiraPlugin:
122+
enabled: false
123+
browserStack:
124+
enabled: false
125+
enableTunnel: false
126+
enabledAndValid: false
127+
lambdaTest:
128+
enabled: false
129+
enableTunnel: false
130+
enabledAndValid: false
131+
sauceLabs:
132+
enabled: false
133+
enableTunnel: false
134+
enableImageInjection: false
135+
enabledAndValid: false
136+
kobiton:
137+
enabled: false
138+
enableTunnel: false
139+
enabledAndValid: false
140+
jdbcDatabase:
141+
enabled: false
142+
configs: []
143+
proxies: []
144+
pagerDuty:
145+
enabled: false
146+
applitools:
147+
enabled: false
148+
reportPortal:
149+
ignoreSSLErrors: false
150+
collectStepStatistics: false
151+
enabled: false
152+
telnyx:
153+
valid: false
154+
phoneProvider: TWILIO
155+
zephyr:
156+
enabled: false
157+
flavor: enterprise
158+
trackingStrategy: project
159+
screenWidth: 1920
160+
screenHeight: 1080
161+
deviceOrientation: PORTRAIT
162+
deviceLanguage: en_US
163+
seleniumChromeHeadlessMode: false
164+
incognitoMode: true
165+
geolocationPermitStrategy: ALLOW
166+
fullPageScreenshot: false
167+
blockNotifications: true
168+
pageReadStrategy: SHORT_XPATH
169+
webPageInfoStrategy: JQUERY_VISIBLE
170+
ocrProcessing: false
171+
alwaysStartNewDriver: true
172+
maximumFrameLevels: 1
173+
waitPageNonEmptyStrategy: DO_NOT_WAIT
174+
measurePageLoad: true
175+
measureTimeBetweenActions: true
176+
waitForScripts: false
177+
automaticAlertHandler: false
178+
loadTestMonitoringIntervals: -1
179+
loadTestConfiguration:
180+
numberOfServers: 10
181+
durationInMinutes: 10
182+
failOption: never
183+
androidWaitForIdleTimeout: 10000
184+
androidWaitForSelectorTimeout: 10000
185+
disabledWebViewContext: false
186+
desktopWebScreenshotStrategy: VIEWPORT_USING_OS
187+
androidDisabledWindowAnimation: false
188+
durationOfHoldForDragAndDropOnIos: 500
189+
snapshotMaxDepth: 50
190+
azureDevOps:
191+
allowAzureDevOpsIntegration: false
192+
childrensDepthClassificationNode: 20
193+
xrayCloud: {}
194+
specificationLanguage: ENGLISH
195+
horizontalScrollStrategy: CENTER
196+
allCombinations: false
197+
disableReadWithoutSourceFirst: true
198+
chromeExtensionPreferences:
199+
enabled: false
200+
extensions: []
201+
userDefinedCapabilities: []
202+
useSynonymsOfDetectors: false
203+
forceToUseDeepestElementInHierarchy: true
204+
ignoreInnerChildButtons: true
205+
showActualVersions: false
206+
allowPdfPreview: false
207+
considerSwitchAsButton: SWITCHS_AND_BUTTONS
208+
scrollBeforeClickStrategy: AUTOMATIC
209+
scrollBeforeEnterStrategy: AUTOMATIC
210+
scrollBeforeCheckStrategy: AUTOMATIC
211+
scrollBeforeAnchorSearchStrategy: AUTOMATIC
212+
treatAllSpanAsLabel: false
213+
isSupportSecondaryRoleValueListOfButton: true
214+
isSupportSecondaryRoleValueListOfSwitch: true
215+
showHttpRequestInfo: false
216+
iosVisibilityStrategy: USE_COORDINATES
217+
aiPreferences:
218+
scrollsToReadPageContext: 1
219+
delayAfterLoginStepInSeconds: 10
220+
delayBeforeProcessPageByAiInMs: 300
221+
useVision: USE_VISION
222+
autoHealReusableRules: DISABLED
223+
autoHealSingleCommands: DISABLED
224+
appContextImages: []
225+
timezone: America/Los_Angeles
226+
monitoringTimezone: America/Bahia
227+
monitoringBranch: BRANCH
228+
sourceExtraMobileAppFiles: []
229+
extraMobileAppFiles: []
230+
clientCertificates: []
231+
maximumNumberOfSteps: 5000
232+
clearTextSelectionStrategy: CTRL_A
233+
shadowDomSupport: ENABLED
234+
waitUpToTimesUntilStrategy: CALCULATE_TIME_AND_TIMEOUT
235+
useOpacityToDetermineVisibilityWeb: USE_OPACITY
236+
delayBetweenSendKeys: 10
237+
overlappedElementsStrategy: DONT_ALLOW_OVERLAPPED
238+
screenshotOrderMobileNative: BEFORE_SOURCE
239+
iosClickInvisibleButtonStrategy: CLICK
240+
prioritizeVisibleTextStrategy: ALL_ATTRIBUTES_EQUALLY
241+
restrictParallelization: false
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
click "New Luma Yoga Collection Get fit and look fab in new seasonal styles Shop New Yoga"
2+
click "Ida Workout Parachute Pant"
3+
click "28"
4+
click "Blue"
5+
click "Add to Cart"
6+
check if page contains "Add to Cart"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
click "Create an Account"
2+
generate from template "%$$$$$$", then enter into "First Name" and save it as "firstName"
3+
generate from template "%$$$$$$", then enter into "Last Name" and save it as "lastName"
4+
generate unique email, then enter into "Email" and save as "Email"
5+
enter stored value "password" into "Password"
6+
enter stored value "password" into "Confirm Password"
7+
click "Create an Account" below "Confirm Password"
8+
validate that page contains "Thank you for registering"
9+
validate that page contains string with parameters "Welcome, ${firstName} ${lastName}"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
click "Proceed to Checkout"
2+
wait 1 sec until page contains "Shipping Address"
3+
fill out required fields of form "Shipping Address" with sample values
4+
click "$" roughly below "Shipping methods"
5+
click "Next"
6+
click "Place Order"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
scroll down
2+
click "Cronus Yoga Pant"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
click "Josie Yoga Jacket"
2+
click "XS"
3+
click "Blue"
4+
click "Add to Cart"

dev/tests/testRigor/rules/select size and color.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)