Skip to content

Commit

Permalink
ci: Hide the github button in e2e tests (no-changelog)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Nov 14, 2024
1 parent 15ca2c4 commit c741b8d
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 17 deletions.
4 changes: 0 additions & 4 deletions cypress/e2e/1-workflows.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('Workflows', () => {
});

it('should create multiple new workflows using add workflow button', () => {
cy.viewport(1920, 1080);
[...Array(multipleWorkflowsCount).keys()].forEach(() => {
cy.visit(WorkflowsPage.url);
WorkflowsPage.getters.createWorkflowButton().click();
Expand All @@ -36,7 +35,6 @@ describe('Workflows', () => {
});

it('should search for a workflow', () => {
cy.viewport(1920, 1080);
// One Result
WorkflowsPage.getters.searchBar().type('Empty State Card Workflow');
WorkflowsPage.getters.workflowCards().should('have.length', 1);
Expand All @@ -62,7 +60,6 @@ describe('Workflows', () => {
});

it('should delete all the workflows', () => {
cy.viewport(1920, 1080);
WorkflowsPage.getters.workflowCards().should('have.length', multipleWorkflowsCount + 1);

WorkflowsPage.getters.workflowCards().each(($el) => {
Expand All @@ -78,7 +75,6 @@ describe('Workflows', () => {
});

it('should respect tag querystring filter when listing workflows', () => {
cy.viewport(1920, 1080);
WorkflowsPage.getters.newWorkflowButtonCard().click();

cy.createFixtureWorkflow('Test_workflow_2.json', getUniqueWorkflowName('My New Workflow'));
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/17-workflow-tags.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('Workflow tags', () => {
});

it('should detach a tag inline by clicking on X on tag pill', () => {
cy.viewport(1920, 1080);
wf.getters.createTagButton().click();
wf.actions.addTags(TEST_TAGS);
wf.getters.nthTagPill(1).click();
Expand All @@ -74,7 +73,6 @@ describe('Workflow tags', () => {
});

it('should not show non existing tag as a selectable option', () => {
cy.viewport(1920, 1080);
const NON_EXISTING_TAG = 'My Test Tag';

wf.getters.createTagButton().click();
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/19-execution.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ describe('Execution', () => {
});

it('should send proper payload for node rerun', () => {
cy.viewport(1920, 1080);
cy.createFixtureWorkflow('Multiple_trigger_node_rerun.json', 'Multiple trigger node rerun');

workflowPage.getters.zoomToFitButton().click();
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/20-workflow-executions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ describe('Workflow Executions', () => {
});

it('should show workflow data in executions tab after hard reload and modify name and tags', () => {
cy.viewport(1920, 1080);
executionsTab.actions.switchToExecutionsTab();
checkMainHeaderELements();
workflowPage.getters.saveButton().find('button').should('not.exist');
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/34-template-credentials-setup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ describe('Template credentials setup', () => {
});

it('should fill credentials from workflow editor', () => {
cy.viewport(1920, 1080);
templateCredentialsSetupPage.visitTemplateCredentialSetupPage(testTemplate.id);
templateCredentialsSetupPage.getters.skipLink().click();

Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/45-ai-assistant.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('AI Assistant::enabled', () => {
});

it('renders placeholder UI', () => {
cy.viewport(1920, 1080);
aiAssistant.getters.askAssistantFloatingButton().should('be.visible');
aiAssistant.getters.askAssistantFloatingButton().click();
aiAssistant.getters.askAssistantChat().should('be.visible');
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe('NDV', () => {
});

it('should disconect Switch outputs if rules order was changed', () => {
cy.viewport(1920, 1080);
cy.createFixtureWorkflow('NDV-test-switch_reorder.json', 'NDV test switch reorder');
workflowPage.actions.zoomToFit();

Expand Down Expand Up @@ -233,7 +232,6 @@ describe('NDV', () => {
ndv.getters.outputPanel().find('[class*=_pagination]').should('exist');
});
it('should display large schema', () => {
cy.viewport(1920, 1080);
cy.createFixtureWorkflow(
'Test_workflow_schema_test_pinned_data.json',
'NDV test schema view 2',
Expand Down Expand Up @@ -720,7 +718,6 @@ describe('NDV', () => {
});

it('Should open appropriate node creator after clicking on connection hint link', () => {
cy.viewport(1920, 1080);
const nodeCreator = new NodeCreator();
const hintMapper = {
Memory: 'AI Nodes',
Expand Down
3 changes: 2 additions & 1 deletion packages/@n8n/api-types/src/frontend-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export interface IUserManagementSettings {
}

export interface FrontendSettings {
isDocker?: boolean;
inE2ETests: boolean;
isDocker: boolean;
databaseType: 'sqlite' | 'mariadb' | 'mysqldb' | 'postgresdb';
endpointForm: string;
endpointFormTest: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/services/frontend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import path from 'path';
import { Container, Service } from 'typedi';

import config from '@/config';
import { LICENSE_FEATURES, N8N_VERSION } from '@/constants';
import { inE2ETests, LICENSE_FEATURES, N8N_VERSION } from '@/constants';
import { CredentialTypes } from '@/credential-types';
import { CredentialsOverwrites } from '@/credentials-overwrites';
import { getVariablesLimit } from '@/environments/variables/environment-helpers';
Expand Down Expand Up @@ -82,6 +82,7 @@ export class FrontendService {
}

this.settings = {
inE2ETests,
isDocker: this.isDocker(),
databaseType: this.globalConfig.database.type,
previewMode: process.env.N8N_PREVIEW_MODE === 'true',
Expand Down
1 change: 1 addition & 0 deletions packages/editor-ui/src/__tests__/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { FrontendSettings } from '@n8n/api-types';

export const defaultSettings: FrontendSettings = {
inE2ETests: false,
databaseType: 'sqlite',
isDocker: false,
pruning: {
Expand Down
8 changes: 6 additions & 2 deletions packages/editor-ui/src/components/MainHeader/MainHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useSourceControlStore } from '@/stores/sourceControl.store';
import { useUIStore } from '@/stores/ui.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useExecutionsStore } from '@/stores/executions.store';
import { useSettingsStore } from '@/stores/settings.store';
import { usePushConnection } from '@/composables/usePushConnection';
import GithubButton from 'vue-github-button';
Expand All @@ -29,6 +30,7 @@ const uiStore = useUIStore();
const sourceControlStore = useSourceControlStore();
const workflowsStore = useWorkflowsStore();
const executionsStore = useExecutionsStore();
const settingsStore = useSettingsStore();
const activeHeaderTab = ref(MAIN_HEADER_TABS.WORKFLOW);
const workflowToReturnTo = ref('');
Expand All @@ -50,6 +52,7 @@ const workflowId = computed(() =>
);
const onWorkflowPage = computed(() => !!(route.meta.nodeView || route.meta.keepWorkflowAlive));
const readOnly = computed(() => sourceControlStore.preferences.branchReadOnly);
const showGitHubButton = computed(() => !settingsStore.settings.inE2ETests);
watch(route, (to, from) => {
syncTabsWithRoute(to, from);
Expand Down Expand Up @@ -184,15 +187,16 @@ async function navigateToExecutionsView(openInNewTab: boolean) {
@update:model-value="onTabSelected"
/>
</div>
<div class="github-button">
<div class="github-button" v-if="showGitHubButton">
<GithubButton
href="https://github.com/n8n-io/n8n"
:data-color-scheme="uiStore.appliedTheme"
data-size="large"
data-show-count="true"
aria-label="Star n8n-io/n8n on GitHub"
>Star</GithubButton
>
Star
</GithubButton>
</div>
</div>
</template>
Expand Down

0 comments on commit c741b8d

Please sign in to comment.