Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
2798c45
added sample test
sreichel Mar 15, 2025
7543a87
added workflow
sreichel Mar 15, 2025
86508e3
added workflow - DDEV config
sreichel Mar 15, 2025
1928f68
added workflow - DDEV config fix
sreichel Mar 15, 2025
dbd4278
cypress config
sreichel Mar 15, 2025
1cf602d
cypress test
sreichel Mar 15, 2025
381f030
Merge branch 'main' into cypress-test
sreichel Mar 25, 2025
781f18a
config
sreichel Mar 25, 2025
9158d02
test
sreichel Mar 25, 2025
1ae9208
test
sreichel Mar 25, 2025
96d9592
tests
sreichel Mar 25, 2025
8822c0b
tests
sreichel Mar 25, 2025
b245adc
tests
sreichel Mar 25, 2025
91ba51f
tests
sreichel Mar 25, 2025
56938bc
tests
sreichel Mar 25, 2025
aad279d
tests
sreichel Mar 25, 2025
80e5c7b
tests
sreichel Mar 25, 2025
fe73c97
update
sreichel Apr 7, 2025
8df2044
update
sreichel Apr 7, 2025
f590650
Merge remote-tracking branch 'origin/cypress-test' into cypress-test
sreichel Apr 8, 2025
23ee808
update
sreichel Apr 8, 2025
bc60bb2
update
sreichel Apr 8, 2025
d18a54e
minor update
sreichel Apr 8, 2025
f97d8fe
minor update
sreichel Apr 8, 2025
bf4f910
minor update
sreichel Apr 8, 2025
9986f69
minor update
sreichel Apr 8, 2025
1f22ace
minor update
sreichel Apr 9, 2025
b032b3e
minor update
sreichel Apr 9, 2025
73dfc54
update
sreichel Apr 9, 2025
b24e5b3
update
sreichel Apr 9, 2025
734dd7f
update
sreichel Apr 9, 2025
352c775
update
sreichel Apr 9, 2025
9031a65
typo
sreichel Apr 9, 2025
65681ac
update
sreichel Apr 9, 2025
f94675a
update
sreichel Apr 10, 2025
3390b4d
update
sreichel Apr 10, 2025
07cbb8c
update
sreichel Apr 10, 2025
bdcba9d
update
sreichel Apr 10, 2025
443bafa
update
sreichel Apr 10, 2025
41b21b5
update
sreichel Apr 10, 2025
fa65ee7
update
sreichel Apr 11, 2025
3887a90
update
sreichel Apr 11, 2025
e69244f
update
sreichel Apr 11, 2025
ce93d27
update
sreichel Apr 11, 2025
fcd8fa9
update
sreichel Apr 11, 2025
a34994a
update
sreichel Apr 11, 2025
4883cec
update
sreichel Apr 11, 2025
3dad8ff
update
sreichel Apr 11, 2025
7400270
update
sreichel Apr 11, 2025
4b9d0fd
Merge branch 'OpenMage:main' into cypress-test
sreichel Apr 19, 2025
c840519
workflow
sreichel Apr 19, 2025
b133b74
workflow
sreichel Apr 19, 2025
70d1a29
workflow
sreichel Apr 19, 2025
e3a7f2f
workflow
sreichel Apr 19, 2025
a88c531
workflow
sreichel Apr 19, 2025
407e173
workflow
sreichel Apr 19, 2025
a21f2d6
workflow
sreichel Apr 19, 2025
2c3c60e
.gitignore
sreichel Apr 19, 2025
036f1a6
.gitignore
sreichel Apr 19, 2025
793c1cc
test
sreichel Apr 19, 2025
1e74b8b
test
sreichel Apr 19, 2025
0e78211
revert test
sreichel Apr 19, 2025
b11f990
workflow
sreichel Apr 19, 2025
d122aea
Merge branch 'main' into cypress-test
sreichel Apr 20, 2025
38c2702
Merge branch 'main' into cypress-test
sreichel Apr 21, 2025
c5d08d5
added test
sreichel Apr 23, 2025
4ec3601
update
sreichel Apr 23, 2025
a912d1a
update
sreichel Apr 23, 2025
9e84450
added pseudo test, ref #4741
sreichel Apr 23, 2025
636b0cc
test apache/nginx
sreichel Apr 23, 2025
2e448e3
Merge branch 'main' into cypress-test
colinmollenhour Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'https://magento-lts.ddev.site'
},
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'https://magento-lts.ddev.site',
}
};
8 changes: 7 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -934,4 +934,10 @@
- any-glob-to-any-file: [
.rector.php,
.github/workflows/rector.yml
]
]

'cypress':
- changed-files:
- any-glob-to-any-file: [
cypress/*
]
12 changes: 12 additions & 0 deletions .github/workflows/check-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ on:
phpunit:
description: "Count changed PHPUnit files"
value: ${{ jobs.check.outputs.phpunit }}
cypress:
description: "Count changed Cypress files"
value: ${{ jobs.check.outputs.cypress }}
# Allow manually triggering the workflow.
workflow_dispatch:

Expand All @@ -59,6 +62,7 @@ jobs:
phpstan: ${{ steps.changes-phpstan.outputs.phpstan }}
phpunit-test: ${{ steps.changes-phpunit-test.outputs.phpunit-test }}
phpunit: ${{ steps.changes-phpunit.outputs.phpunit }}
cypress: ${{ steps.changes-cypress.outputs.cypress }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -194,3 +198,11 @@ jobs:
count="$(grep -oE "**phpunit**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
echo "$count PHPUnit file(s) changed"
echo "phpunit=$count" >> $GITHUB_OUTPUT

- name: Check if Cypress files changed
id: changes-cypress
if: steps.changed-files-specific.outputs.any_modified == 'true'
run: |
count="$(grep -oE "cypress/" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
echo "$count Cypress file(s) changed"
echo "cypress=$count" >> $GITHUB_OUTPUT
39 changes: 39 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Cypress

on:
workflow_call:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
name: Cypress
runs-on: [ubuntu-latest]
strategy:
matrix:
webserver: ['apache-fpm', 'nginx-fpm']

steps:
- uses: actions/checkout@v1
- name: Setup DDEV
uses: ddev/github-action-setup-ddev@v1
with:
autostart: false

# install DDEV configuration
- run: ddev config --project-type=magento --php-version=8.1 --webserver-type=${{ matrix.webserver }}

# install composer dependencies
- run: ddev composer install

# install openmage
- run: ddev openmage-install -q

# install cypress-addon
- run: ddev add-on get tyler36/ddev-cypress

# start ddev
- run: ddev start

# run cypress
- run: ddev cypress-run --config-file .cypress.config.js
11 changes: 11 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,14 @@ jobs:
needs.check.outputs.phpunit > 0 ||
needs.check.outputs.workflow > 0
uses: ./.github/workflows/phpunit.yml

cypress:
name: Cypress E2E Tests
needs: [check, php-cs-fixer]
if: |
needs.check.outputs.cypress > 0 ||
needs.check.outputs.php > 0 ||
needs.check.outputs.phtml > 0 ||
needs.check.outputs.xml > 0 ||
needs.check.outputs.workflow > 0
uses: ./.github/workflows/cypress.yml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,9 @@ app/etc/includes/ddev.xhgui.php
# local development
.localdev

# cypress
cypress/screenshots/
cypress/videos/

# rector
.rector.result.cache
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Widget/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function getHeaderText()
*/
public function getHeaderCssClass()
{
return 'head-' . strtr($this->_controller, '_', '-');
return 'icon-head head-' . strtr($this->_controller, '_', '-');
}

/**
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Sitemap/etc/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Valid values range: from 0.0 to 1.0.</comment>
<frontend_class>validate-number</frontend_class>
<validate>required-entry validate-number validate-number-range number-range-0-1</validate>
</priority>
<lastmod translate="label">
<label>Show lastmod</label>
Expand Down Expand Up @@ -85,7 +85,7 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Valid values range: from 0.0 to 1.0.</comment>
<frontend_class>validate-number</frontend_class>
<validate>required-entry validate-number validate-number-range number-range-0-1</validate>
</priority>
<lastmod translate="label">
<label>Show lastmod</label>
Expand Down Expand Up @@ -122,7 +122,7 @@
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Valid values range: from 0.0 to 1.0.</comment>
<frontend_class>validate-number</frontend_class>
<validate>required-entry validate-number validate-number-range number-range-0-1</validate>
</priority>
<lastmod translate="label">
<label>Show lastmod</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<?php $_iterator = 1; ?>
<?php foreach ($_tab->getSections() as $_section): ?>
<dd>
<a href="<?php echo $_section->getUrl() ?>" class="<?php echo $_section->getClass() ?><?php if($_section->getId()==$this->getActiveSection()): ?> active<?php endif ?> <?php echo $_section->getIsLast()?'last':'' ?>">
<a href="<?php echo $_section->getUrl() ?>" id="section-<?php echo $_section->getId() ?>" class="<?php echo $_section->getClass() ?><?php if($_section->getId()==$this->getActiveSection()): ?> active<?php endif ?> <?php echo $_section->getIsLast()?'last':'' ?>">
<span <?php if($_tab->getId()==$this->getActiveTab()): ?>class="active"<?php endif ?>>
<?php echo $_section->getLabel() ?>
</span>
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/catalog/categories.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.catalog.categories

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
20 changes: 20 additions & 0 deletions cypress/e2e/openmage/backend/catalog/products.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const route = cy.testRoutes.backend.catalog.products

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});

it(`tests filter options`, () => {
cy.log('Checking for the number of filter type options');
cy.get('#productGrid_product_filter_type option').should('have.length', 7);

cy.log('Checking for the number of filter visibility options');
cy.get('#productGrid_product_filter_visibility option').should('have.length', 5);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/catalog/search.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.catalog.search

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/catalog/sitemap.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.catalog.sitemap

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.catalog.urlrewrite

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/cms/block.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.cms.block

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/cms/page.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.cms.page

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/cms/widget.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.cms.widget

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/customer/group.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.customers.groups

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/customer/manage.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.customers.manage

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/customer/online.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.customers.online

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
33 changes: 33 additions & 0 deletions cypress/e2e/openmage/backend/login.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
describe('Check admin login', () => {
beforeEach('Log in the user', () => {
cy.visit('/admin');
});

const login = cy.openmage.login.admin

it('tests valid login', () => {
const username = login.username.value;
const password = login.password.value;

cy.log(`Logging in as ${username}`);
cy.get(login.username._id).clear().type(username).should('have.value', username);
cy.get(login.password._id).clear().type(password).should('have.value', password);
cy.get(login._submit.__selector).click();
})

it('tests invalid login', () => {
const username = 'abc';
const password = '123';

cy.log(`Logging in as ${username}`);
cy.get(login.username._id).clear().type(username).should('have.value', username);
cy.get(login.password._id).clear().type(password).should('have.value', password);
cy.get(login._submit.__selector).click();
})

it('tests empty login', () => {
cy.get(login.username._id).clear().should('have.value', '');
cy.get(login.password._id).clear().should('have.value', '');
cy.get(login._submit.__selector).click();
})
})
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/newsletter/queue.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.newsletter.queue

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
12 changes: 12 additions & 0 deletions cypress/e2e/openmage/backend/newsletter/report.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const route = cy.testRoutes.backend.newsletter.report

describe(`Checks admin system "${route.h3}"`, () => {
beforeEach('Log in the user', () => {
cy.adminLogIn();
cy.adminGoToTestRoute(route);
});

it(`tests classes and title`, () => {
cy.adminTestRoute(route);
});
});
Loading
Loading