-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into releases/august
- Loading branch information
Showing
5 changed files
with
254 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
paths: | ||
- "packages/**" | ||
- "examples/**" | ||
- "cypress/e2e/**" | ||
types: | ||
- labeled | ||
- synchronize | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/// <reference types="cypress" /> | ||
/// <reference types="../../cypress/support" /> | ||
|
||
Cypress.on("uncaught:exception", () => { | ||
return false; | ||
}); | ||
|
||
describe("i18n-nextjs", () => { | ||
beforeEach(() => { | ||
cy.clearAllCookies(); | ||
cy.clearAllLocalStorage(); | ||
cy.clearAllSessionStorage(); | ||
|
||
cy.interceptGETBlogPosts(); | ||
cy.visit("/"); | ||
}); | ||
|
||
it("should change", () => { | ||
cy.wait("@getBlogPosts"); | ||
|
||
// check the elements are in English which is the default language | ||
cy.get(".ant-menu > .ant-menu-item") | ||
.contains("Blog Posts") | ||
.get(".ant-page-header-heading-left") | ||
.contains("Posts") | ||
.get(".refine-create-button") | ||
.contains("Create") | ||
.get(".ant-table-thead > tr > :nth-child(2)") | ||
.contains("Title") | ||
.get(".ant-table-thead > tr > :nth-child(3)") | ||
.contains("Content") | ||
.get(".ant-table-thead > tr > :nth-child(4)") | ||
.contains("Category") | ||
.get(".ant-table-thead > tr > :nth-child(5)") | ||
.contains("Status") | ||
.get(".ant-table-thead > tr > :nth-child(6)") | ||
.contains("Created At") | ||
.get(".ant-table-thead > tr > :nth-child(7)") | ||
.contains("Actions"); | ||
|
||
// find the language button | ||
cy.get(".ant-layout-header > .ant-btn") | ||
// should contain English which is the default language | ||
.contains("English") | ||
// hover over the button to show the dropdown | ||
.trigger("mouseover") | ||
// click on the German language | ||
.get(".ant-dropdown-menu-title-content") | ||
.contains("German") | ||
.click() | ||
// should contain German | ||
.get(".ant-layout-header > .ant-btn") | ||
.contains("German"); | ||
|
||
// check the elements are translated | ||
cy.get(".ant-menu > .ant-menu-item") | ||
.contains("Einträge") | ||
.get(".ant-page-header-heading-left") | ||
.contains("Einträge") | ||
.get(".refine-create-button") | ||
.contains("Erstellen") | ||
.get(".ant-table-thead > tr > :nth-child(2)") | ||
.contains("Titel") | ||
.get(".ant-table-thead > tr > :nth-child(3)") | ||
.contains("Inhalh") | ||
.get(".ant-table-thead > tr > :nth-child(4)") | ||
.contains("Kategorie") | ||
.get(".ant-table-thead > tr > :nth-child(5)") | ||
.contains("Status") | ||
.get(".ant-table-thead > tr > :nth-child(6)") | ||
.contains("Erstellt am") | ||
.get(".ant-table-thead > tr > :nth-child(7)") | ||
.contains("Aktionen"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/// <reference types="cypress" /> | ||
/// <reference types="../../cypress/support" /> | ||
|
||
Cypress.on("uncaught:exception", () => { | ||
return false; | ||
}); | ||
|
||
describe("i18n-react", () => { | ||
beforeEach(() => { | ||
cy.clearAllCookies(); | ||
cy.clearAllLocalStorage(); | ||
cy.clearAllSessionStorage(); | ||
|
||
cy.interceptGETPosts(); | ||
cy.visit("/"); | ||
}); | ||
|
||
it("should change", () => { | ||
cy.wait("@getPosts"); | ||
|
||
// check the elements are in English which is the default language | ||
cy.get(".ant-menu > .ant-menu-item") | ||
.contains("Posts") | ||
.get(".ant-page-header-heading-left") | ||
.contains("Posts") | ||
.get(".refine-create-button") | ||
.contains("Create") | ||
.get(".ant-table-thead > tr > :nth-child(2)") | ||
.contains("Title") | ||
.get(".ant-table-thead > tr > :nth-child(3)") | ||
.contains("Category") | ||
.get(".ant-table-thead > tr > :nth-child(4)") | ||
.contains("Actions"); | ||
|
||
// find the language button | ||
cy.get(".ant-layout-header > .ant-btn") | ||
// should contain English which is the default language | ||
.contains("English") | ||
// hover over the button to show the dropdown | ||
.trigger("mouseover") | ||
// click on the German language | ||
.get(".ant-dropdown-menu-title-content") | ||
.contains("German") | ||
.click() | ||
// should contain German | ||
.get(".ant-layout-header > .ant-btn") | ||
.contains("German"); | ||
|
||
// check the elements are translated | ||
cy.get(".ant-menu > .ant-menu-item") | ||
.contains("Einträge") | ||
.get(".ant-page-header-heading-left") | ||
.contains("Einträge") | ||
.get(".refine-create-button") | ||
.contains("Erstellen") | ||
.get(".ant-table-thead > tr > :nth-child(2)") | ||
.contains("Titel") | ||
.get(".ant-table-thead > tr > :nth-child(3)") | ||
.contains("Kategorie") | ||
.get(".ant-table-thead > tr > :nth-child(4)") | ||
.contains("Aktionen"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters