-
-
Notifications
You must be signed in to change notification settings - Fork 529
fixed issue #965 Corrected redirection to Github and Nest profile and test files #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d3ef8df
Corrected redirection to Github and Nest profile
KaranNegi20Feb 96f5bb6
Merge branch 'OWASP:main' into fix/redirection-of-links
KaranNegi20Feb 55e4b39
Correction p2: redirection to Github and Nest profile
KaranNegi20Feb 0968912
Correction p2: redirection to Github and Nest profile
KaranNegi20Feb 92fe3ed
Merge branch 'main' into fix/redirection-of-links
kasya 71990ac
Merge branch 'OWASP:main' into fix/redirection-of-links
KaranNegi20Feb b2524fd
Merge branch 'OWASP:main' into fix/redirection-of-links
KaranNegi20Feb 8421c6e
Merge branch 'OWASP:main' into fix/redirection-of-links
KaranNegi20Feb f527f9e
Fixed redirection issues and updated related tests
KaranNegi20Feb e44cdcb
Resolved merge conflicts
KaranNegi20Feb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,101 @@ | ||
| import { test, expect } from '@playwright/test' | ||
| import { mockProjectDetailsData } from '@unit/data/mockProjectDetailsData' | ||
|
|
||
| test.describe('Project Details Page', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.route('**/graphql/', async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| json: { data: mockProjectDetailsData }, | ||
| }) | ||
| }) | ||
| await page.goto('/projects/test-project') | ||
| }) | ||
|
|
||
| test('should have a heading and summary', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Test Project' })).toBeVisible() | ||
| await expect( | ||
| page.getByText('An example project showcasing GraphQL and Django integration.') | ||
| ).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project details block', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Project Details' })).toBeVisible() | ||
| await expect(page.getByText('Last Updated: Feb 7, 2025')).toBeVisible() | ||
| await expect(page.getByText('Level: Lab')).toBeVisible() | ||
| await expect(page.getByText('Project Leaders: alice, bob')).toBeVisible() | ||
| await expect(page.getByText('URL: https://github.com/')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project statics block', async ({ page }) => { | ||
| await expect(page.getByText('2.2K Stars')).toBeVisible() | ||
| await expect(page.getByText('10 Forks')).toBeVisible() | ||
| await expect(page.getByText('1.2K Contributors')).toBeVisible() | ||
| await expect(page.getByText('10 Issues')).toBeVisible() | ||
| await expect(page.getByText('3 Repositories')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project topics', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Topics' })).toBeVisible() | ||
| await expect(page.getByText('graphql', { exact: true })).toBeVisible() | ||
| await expect(page.getByText('django', { exact: true })).toBeVisible() | ||
| await expect(page.getByText('backend')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project languages', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Languages' })).toBeVisible() | ||
| await expect(page.getByText('Python', { exact: true })).toBeVisible() | ||
| await expect(page.getByText('GraphQL', { exact: true })).toBeVisible() | ||
| await expect(page.getByText('JavaScript', { exact: true })).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have top contributors', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Top Contributors' })).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Contributor 1' })).toBeVisible() | ||
| await expect(page.getByText('Contributor 1')).toBeVisible() | ||
| await expect(page.getByText('30 Contributions')).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Contributor 2' })).toBeVisible() | ||
| await expect(page.getByText('Contributor 2')).toBeVisible() | ||
| await expect(page.getByText('29 Contributions')).toBeVisible() | ||
| }) | ||
|
|
||
| test('toggle top contributors', async ({ page }) => { | ||
| await expect(page.getByRole('button', { name: 'Show more' })).toBeVisible() | ||
| await page.getByRole('button', { name: 'Show more' }).click() | ||
| await expect(page.getByRole('button', { name: 'Show less' })).toBeVisible() | ||
| await page.getByRole('button', { name: 'Show less' }).click() | ||
| await expect(page.getByRole('button', { name: 'Show more' })).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project recent issues', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Recent Issues' })).toBeVisible() | ||
| await expect(page.getByRole('heading', { name: 'Fix authentication bug' })).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Dave Debugger' })).toBeVisible() | ||
| await expect(page.getByText('Feb 5, 2025')).toBeVisible() | ||
| await expect(page.getByText('5 comments')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project recent releases', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Recent Releases' })).toBeVisible() | ||
| await expect(page.getByRole('heading', { name: 'V1.2.0' })).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Charlie Dev' })).toBeVisible() | ||
| await expect(page.getByText('Jan 20, 2025')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have project repositories', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Repositories' })).toBeVisible() | ||
| await expect(page.getByText('Repo One')).toBeVisible() | ||
| await expect(page.getByText('Stars95')).toBeVisible() | ||
| await expect(page.getByText('Forks12')).toBeVisible() | ||
| await expect(page.getByText('Contributors40')).toBeVisible() | ||
| await expect(page.getByText('Issues6')).toBeVisible() | ||
| await expect(page.getByText('Repo Two')).toBeVisible() | ||
| await expect(page.getByText('Stars60')).toBeVisible() | ||
| await expect(page.getByText('Forks8')).toBeVisible() | ||
| await expect(page.getByText('Contributors30')).toBeVisible() | ||
| await expect(page.getByText('Issues3', { exact: true })).toBeVisible() | ||
|
|
||
| await page.getByText('Repo One').click() | ||
| expect(page.url()).toContain('repositories/repo-1') | ||
| }) | ||
| }) |
This file contains hidden or 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,79 @@ | ||
| import { test, expect } from '@playwright/test' | ||
| import { mockRepositoryData } from '@unit/data/mockRepositoryData' | ||
|
|
||
| test.describe('Repository Details Page', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.route('**/graphql/', async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| json: { data: mockRepositoryData }, | ||
| }) | ||
| }) | ||
| await page.goto('/projects/test-project/repositories/test-repository') | ||
| }) | ||
|
|
||
| test('should have a heading and summary', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Test Repo' })).toBeVisible() | ||
| await expect(page.getByText('A sample test repository')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have repository details block', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Repository Details' })).toBeVisible() | ||
| await expect(page.getByText('Last Updated: Jan 1, 2024')).toBeVisible() | ||
| await expect(page.getByText('License: MIT')).toBeVisible() | ||
| await expect(page.getByText('Size: 1200 KB')).toBeVisible() | ||
| await expect(page.getByRole('link', { name: 'https://github.com/test-repo' })).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have statics block', async ({ page }) => { | ||
| await expect(page.getByText('50K Stars')).toBeVisible() | ||
| await expect(page.getByText('3K Forks')).toBeVisible() | ||
| await expect(page.getByText('5 Contributors')).toBeVisible() | ||
| await expect(page.getByText('2 Issues')).toBeVisible() | ||
| await expect(page.getByText('10 Commits')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have topics', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Topics' })).toBeVisible() | ||
| await expect(page.getByText('JavaScript', { exact: true })).toBeVisible() | ||
| await expect(page.getByText('TypeScript', { exact: true })).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have languages', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Languages' })).toBeVisible() | ||
| await expect(page.getByText('web', { exact: true })).toBeVisible() | ||
| await expect(page.getByText('security', { exact: true })).toBeVisible() | ||
| }) | ||
| test('should have top contributors', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Top Contributors' })).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Contributor 1' })).toBeVisible() | ||
| await expect(page.getByText('Contributor 1')).toBeVisible() | ||
| await expect(page.getByText('30 Contributions')).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Contributor 2' })).toBeVisible() | ||
| await expect(page.getByText('Contributor 2')).toBeVisible() | ||
| await expect(page.getByText('29 Contributions')).toBeVisible() | ||
| }) | ||
|
|
||
| test('toggle top contributors', async ({ page }) => { | ||
| await expect(page.getByRole('button', { name: 'Show more' })).toBeVisible() | ||
| await page.getByRole('button', { name: 'Show more' }).click() | ||
| await expect(page.getByRole('button', { name: 'Show less' })).toBeVisible() | ||
| await page.getByRole('button', { name: 'Show less' }).click() | ||
| await expect(page.getByRole('button', { name: 'Show more' })).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have recent issues', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Recent Issues' })).toBeVisible() | ||
| await expect(page.getByRole('heading', { name: 'Bug fix required' })).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Test User 1' })).toBeVisible() | ||
| await expect(page.getByText('Jan 2, 2024')).toBeVisible() | ||
| await expect(page.getByText('4 comments')).toBeVisible() | ||
| }) | ||
|
|
||
| test('should have recent releases', async ({ page }) => { | ||
| await expect(page.getByRole('heading', { name: 'Recent Releases' })).toBeVisible() | ||
| await expect(page.getByRole('heading', { name: 'v1.0.0' })).toBeVisible() | ||
| await expect(page.getByRole('img', { name: 'Test User 2' })).toBeVisible() | ||
| await expect(page.getByText('Jan 1, 2024', { exact: true })).toBeVisible() | ||
| }) | ||
| }) | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the GitHub URL format in the test
This test verifies that the repository URL is displayed and clickable, which directly relates to the PR's goal of fixing GitHub redirection. Ensure this URL format aligns with the actual URL pattern used in production.
🏁 Script executed:
Length of output: 1894
Update the expected GitHub URL in the test to match the production format
The production code builds GitHub URLs using a two-segment structure (e.g.,
https://github.com/OWASP/Nestor dynamically ashttps://github.com/<owner>/<repo>) while the RepositoryDetails test currently asserts the presence of a link with text"https://github.com/test-repo". Please update the test to include both the owner and repository segments (for example,"https://github.com/testOwner/test-repo"or an equivalent that mirrors the actual URL pattern in production) to fully align with the redirect fix requirements.frontend/__tests__/e2e/pages/RepositoryDetails.spec.ts(around lines 24-26) so that it reflects the correct two-segment URL format.