Skip to content

Commit

Permalink
chore(e2etests): Fixing orgNos and resources to run tests in yt01 (#1927
Browse files Browse the repository at this point in the history
)

<!--- Provide a general summary of your changes in the Title above -->

## Description

Fixing orgNos and resources to match whats in yt01

## Related Issue(s)

- #1862 

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
  • Loading branch information
dagfinno authored Feb 21, 2025
1 parent 322b1c9 commit ffb5a67
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
7 changes: 6 additions & 1 deletion tests/k6/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export const baseUrls = {

export const defaultEndUserOrgNo = "310923044"; // ÆRLIG UROKKELIG TIGER AS
export const defaultEndUserSsn = "08844397713"; // UROMANTISK LITTERATUR, has "DAGL" for 310923044
export const defaultServiceOwnerOrgNo = "991825827";
export const defaultServiceOwnerOrgNo = __ENV.API_ENVIRONMENT == "yt01" ? "713431400" : "991825827";
export const otherOrgNo = __ENV.API_ENVIRONMENT == "yt01" ? "974761076" : "889640782";
export const otherOrgName = __ENV.API_ENVIRONMENT == "yt01" ? "skd" : "nav";
export const otherServiceResource = __ENV.API_ENVIRONMENT == "yt01" ? "app_skd_formueinntekt-skattemelding-v2" : "app_nav_barnehagelister";
export const notValidEnduserId = __ENV.API_ENVIRONMENT == "yt01" ? "08837297959" : "08895699684";


if (__ENV.IS_DOCKER && __ENV.API_ENVIRONMENT == "localdev") {
__ENV.API_ENVIRONMENT = "localdev_docker";
Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/enduser/dialogDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function () {
let dialogId = null;
let dialog = null;

const availableExternalResource = "urn:altinn:resource:app_digdir_be-om-api-nokkel"; // should have "read" on this
const availableExternalResource = "urn:altinn:resource:ttd-dialogporten-automated-tests-correspondence"; // should have "read" on this
const unavailableExternalResource = "urn:altinn:resource:ttd-altinn-events-automated-tests"; // should not have "read" on this
const unavailableSubresource = "someunavailablesubresource"; // should not have "transmissionread" on this;

Expand Down
10 changes: 5 additions & 5 deletions tests/k6/tests/serviceowner/dialogCreateIdempotentKey.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {describe, expect, expectStatusFor, postSO, purgeSO, uuidv7} from '../../common/testimports.js'
import {default as dialogToInsert} from './testdata/01-create-dialog.js';

import { otherOrgName, otherOrgNo, otherServiceResource } from '../../common/config.js';

export default function () {

const dialogs = [];
const navOrg = {
orgName: "nav",
orgNo: "889640782",
orgName: otherOrgName,
orgNo: otherOrgNo,
};

describe('Attempt to create dialog with unused idempotentKey', () => {
Expand All @@ -28,8 +28,8 @@ export default function () {
describe('Attempt to create dialog with same idempotentKey different Org', () => {
let dialog = dialogToInsert();
dialog.idempotentKey = uuidv7();
dialog.serviceResource = "urn:altinn:resource:app_nav_barnehagelister";
dialog.activities[2].performedBy.actorId = "urn:altinn:organization:identifier-no:889640782";
dialog.serviceResource = "urn:altinn:resource:" +otherServiceResource;
dialog.activities[2].performedBy.actorId = "urn:altinn:organization:identifier-no:" + otherOrgNo;

let responseNav = postSO('dialogs', dialog, null, navOrg);
expectStatusFor(responseNav).to.equal(201);
Expand Down
3 changes: 2 additions & 1 deletion tests/k6/tests/serviceowner/dialogSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import { default as dialogToInsert } from './testdata/01-create-dialog.js';

import { getDefaultEnduserOrgNo, getDefaultEnduserSsn } from "../../common/token.js";
import { notValidEnduserId } from '../../common/config.js';

export default function () {

Expand Down Expand Up @@ -203,7 +204,7 @@ export default function () {
})

describe('List with invalid enduserid', () => {
let invalidEndUserId = "urn:altinn:person:identifier-no:08895699684";
let invalidEndUserId = "urn:altinn:person:identifier-no:" + notValidEnduserId;
let r = getSO('dialogs/' + defaultFilter + '&EndUserId=' + invalidEndUserId + '&ServiceResource=' + auxResource);
expectStatusFor(r).to.equal(200);
expect(r, 'response').to.have.validJsonBody();
Expand Down
4 changes: 2 additions & 2 deletions tests/k6/tests/serviceowner/testdata/01-create-dialog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { uuidv4 } from '../../../common/testimports.js'
import { getDefaultEnduserSsn } from "../../../common/token.js";
import { sentinelValue } from "../../../common/config.js";
import { sentinelValue, defaultServiceOwnerOrgNo } from "../../../common/config.js";

export default function (endUser = getDefaultEnduserSsn()) {
return {
Expand Down Expand Up @@ -302,7 +302,7 @@ export default function (endUser = getDefaultEnduserSsn()) {
"type": "Information",
"performedBy": {
"actorType": "partyRepresentative",
"actorId": "urn:altinn:organization:identifier-no:991825827"
"actorId": "urn:altinn:organization:identifier-no:" + defaultServiceOwnerOrgNo
},
"description": [
{
Expand Down

0 comments on commit ffb5a67

Please sign in to comment.