Skip to content

Commit

Permalink
Update module UI tests for API to rely on technicalName now
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Oct 15, 2024
1 parent 8b1ee44 commit 3593c02
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
utilsPlaywright,
} from '@prestashop-core/ui-testing';

const baseContext: string = 'functional_API_endpoints_module_getModuleId';
const baseContext: string = 'functional_API_endpoints_module_getModuleTechnicalName';

describe('API : GET /module/{moduleId}', async () => {
describe('API : GET /module/{technicalName}', async () => {
let apiContext: APIRequestContext;
let browserContext: BrowserContext;
let page: Page;
Expand Down Expand Up @@ -153,10 +153,10 @@ describe('API : GET /module/{moduleId}', async () => {
});

describe('API : Check Data', async () => {
it('should request the endpoint /module/{moduleId}', async function () {
it('should request the endpoint /module/{technicalName}', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'requestEndpoint', baseContext);

const apiResponse = await apiContext.get(`module/${moduleInfo.moduleId}`, {
const apiResponse = await apiContext.get(`module/${moduleInfo.technicalName}`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
Expand All @@ -175,6 +175,7 @@ describe('API : GET /module/{moduleId}', async () => {
'technicalName',
'version',
'enabled',
'installed',
);
});

Expand Down Expand Up @@ -209,6 +210,15 @@ describe('API : GET /module/{moduleId}', async () => {
expect(jsonResponse.enabled).to.be.a('boolean');
expect(jsonResponse.enabled).to.be.equal(moduleInfo.enabled);
});

it('should check the JSON Response : `installed`', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'checkResponseInstalled', baseContext);

expect(jsonResponse).to.have.property('installed');
expect(jsonResponse.installed).to.be.a('boolean');
// todo: https://github.com/PrestaShop/PrestaShop/issues/36953
// expect(jsonResponse.installed).to.be.equal(moduleInfo.installed);
});
});

// Pre-condition: Create an API Client
Expand Down

0 comments on commit 3593c02

Please sign in to comment.